* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Login/Register Screens */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.login-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.login-footer {
    margin-top: 1.5rem;
    color: #666;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

/* Main App */
.container {
    max-width: 100%;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu span {
    font-weight: 500;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 150px);
}

.sidebar {
    width: 300px;
    background: white;
    padding: 1.5rem;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.3rem;
}

.lists-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.list-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.list-item.active {
    background: #e7f3ff;
    border-left-color: #667eea;
}

.list-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.list-item p {
    font-size: 0.85rem;
    color: #666;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.welcome-screen {
    text-align: center;
    padding: 3rem;
}

.welcome-screen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.list-header h2 {
    font-size: 1.8rem;
    color: #667eea;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.records-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.records-table table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.records-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.records-table tr:hover {
    background: #f8f9fa;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.column-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #0066cc;
}

.tab-btn.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.admin-tab {
    padding: 20px 0;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.users-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

.users-table tbody tr:hover {
    background-color: #f9f9f9;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}

/* MFA Styles */
.mfa-enabled,
.mfa-disabled {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.mfa-enabled {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
}

.mfa-disabled {
    background-color: #fff3e0;
    border: 1px solid #ff9800;
}

#mfaQRCode img {
    max-width: 250px;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

#mfaSecret {
    margin: 10px 0 20px 0;
    word-break: break-all;
}

/* Share List Styles */
.shares-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.shares-table th,
.shares-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.shares-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
}

.shares-table tbody tr:hover {
    background-color: #f9f9f9;
}

#shareListForm select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
