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

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --background: #f9fafb;
    --card-background: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom, #dbeafe 0%, #e0f2fe 50%, #dbeafe 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Disable text selection on dashboard */
body.dashboard-page,
body.dashboard-page * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow selection for input fields and textareas */
body.dashboard-page input,
body.dashboard-page textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Subtle paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(59, 130, 246, 0.03) 2px,
            rgba(59, 130, 246, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 24px 24px;
    min-height: calc(100vh - 48px);
    position: relative;
    z-index: 1;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Login Page */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    background: linear-gradient(to bottom, #e8f0fe 0%, #e3edff 50%, #e8f0fe 100%);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.2),
        0 2px 6px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid #3b82f6;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Paper lines pattern */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 23px,
            rgba(59, 130, 246, 0.08) 23px,
            rgba(59, 130, 246, 0.08) 24px
        );
    pointer-events: none;
    z-index: 0;
}

/* Paperclip decorative element */
.login-card::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 20px;
    width: 24px;
    height: 28px;
    border: 2.5px solid #3b82f6;
    border-radius: 0 0 0 8px;
    border-top: none;
    border-right: none;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 85% 100%, 0 100%, 0 40%);
    opacity: 0.6;
    z-index: 1;
}

.login-card h1 {
    text-align: center;
    color: #1e40af;
    margin-bottom: 8px;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.subtitle {
    text-align: center;
    color: #1e3a8a;
    margin-bottom: 32px;
    font-size: 14px;
    position: relative;
    z-index: 2;
}

.login-form {
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1e40af;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
    color: #1e3a8a;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(30, 58, 138, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.15),
        inset 0 1px 2px rgba(59, 130, 246, 0.1);
}

/* Password input wrapper with eye icon */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 45px !important;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 10;
    pointer-events: auto;
    line-height: 1;
}

.password-toggle:hover {
    color: #2563eb;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(to bottom, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 100%;
    box-shadow: 
        0 4px 8px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid #2563eb;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 
        0 6px 12px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: #1d4ed8;
}

.btn-primary:active {
    box-shadow: 
        0 2px 4px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    display: inline-block;
    position: relative;
}

.rocket-spinner {
    animation: rocketFly 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes rocketFly {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateX(4px) translateY(-3px) rotate(-2deg);
        opacity: 0.9;
    }
    50% {
        transform: translateX(8px) translateY(-5px) rotate(0deg);
        opacity: 0.8;
    }
    75% {
        transform: translateX(4px) translateY(-3px) rotate(2deg);
        opacity: 0.9;
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background-color: #4b5563;
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    color: #1e40af;
    border: 2px solid #3b82f6;
    font-weight: 600;
    box-shadow: 
        0 2px 4px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #2563eb;
    box-shadow: 
        0 4px 8px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    color: #1e3a8a;
}

.btn-google svg {
    flex-shrink: 0;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e40af;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #3b82f6;
    box-shadow: 
        0 2px 4px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.btn-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn-link:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #2563eb;
    box-shadow: 
        0 4px 8px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    color: #1e3a8a;
}

.btn-link:hover::before {
    left: 100%;
}

.btn-link:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 4px rgba(79, 70, 229, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    z-index: 2;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(59, 130, 246, 0.3);
}

.divider span {
    position: relative;
    background: linear-gradient(to bottom, #e8f0fe 0%, #e3edff 50%, #e8f0fe 100%);
    padding: 0 16px;
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 600;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    position: relative;
    z-index: 2;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-error {
    background: rgba(254, 242, 242, 0.9);
    color: #991b1b;
    border: 2px solid #fecaca;
}

.alert-success {
    background: rgba(240, 253, 244, 0.9);
    color: #166534;
    border: 2px solid #bbf7d0;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 16px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0%, rgba(232, 240, 254, 0.9) 100%);
    margin-left: -24px;
    margin-right: -24px;
    margin-top: -16px;
    border-radius: 0;
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.dashboard-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.dashboard-header h1 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 400;
    display: block;
    margin-top: 1px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions .btn {
    width: auto;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 12px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

.btn-text {
    display: inline-block;
}

.notes-actions {
    margin-bottom: 32px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.note-card {
    background: linear-gradient(to bottom, #e8f0fe 0%, #e3edff 50%, #e8f0fe 100%);
    padding: 28px;
    border-radius: 8px;
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.15),
        0 1px 3px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid #3b82f6;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Paper lines pattern */
.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 23px,
            rgba(59, 130, 246, 0.08) 23px,
            rgba(59, 130, 246, 0.08) 24px
        );
    pointer-events: none;
    z-index: 0;
}

/* Paperclip decorative element */
.note-card::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 16px;
    width: 20px;
    height: 24px;
    border: 2.5px solid #3b82f6;
    border-radius: 0 0 0 8px;
    border-top: none;
    border-right: none;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 85% 100%, 0 100%, 0 40%);
    opacity: 0.6;
    z-index: 1;
}

.note-card:hover {
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.25),
        0 2px 6px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 2px rgba(59, 130, 246, 0.3);
    border-color: #2563eb;
    background: linear-gradient(to bottom, #e0ecff 0%, #dbeafe 50%, #e0ecff 100%);
}

.note-card:hover::after {
    opacity: 0.8;
    border-color: #2563eb;
}

.note-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1e40af;
    line-height: 1.3;
    padding-left: 36px;
    position: relative;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.note-icon {
    position: absolute;
    left: 0;
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(30, 64, 175, 0.3));
    transition: filter 0.3s ease;
    z-index: 2;
}

.note-card:hover .note-icon {
    filter: drop-shadow(0 2px 4px rgba(30, 64, 175, 0.4));
}

.note-description {
    color: #1e3a8a;
    font-size: 14.5px;
    margin-bottom: 24px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
    letter-spacing: 0.01em;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    box-shadow: inset 0 1px 2px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.note-card:hover .note-description {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 1px 3px rgba(59, 130, 246, 0.15);
}

.note-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    padding-left: 0;
}

.note-meta {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
}

/* Hide note-meta on dashboard cards */
.notes-grid .note-meta {
    display: none;
}

.note-meta small {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #1e3a8a;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7) 0%, rgba(232, 240, 254, 0.6) 100%);
    border-radius: 12px;
    border: 2px dashed #3b82f6;
    position: relative;
    z-index: 2;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

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

.modal-content {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98) 0%, rgba(232, 240, 254, 0.95) 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 
        0 20px 60px rgba(59, 130, 246, 0.3),
        0 8px 24px rgba(59, 130, 246, 0.2);
    border: 2px solid #3b82f6;
    animation: modalSlideIn 0.3s;
    backdrop-filter: blur(10px);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(to bottom, rgba(232, 240, 254, 0.5) 0%, transparent 100%);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
}

.modal form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Settings Page */
.settings-section {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(232, 240, 254, 0.8) 100%);
    padding: 36px;
    border-radius: 12px;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.15),
        0 2px 6px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
    border: 2px solid #3b82f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.settings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
    opacity: 0.8;
}

.settings-section:hover {
    box-shadow: 
        0 6px 16px rgba(59, 130, 246, 0.2),
        0 3px 8px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: #2563eb;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0%, rgba(224, 242, 254, 0.9) 100%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.section-header > div:first-child {
    flex: 1;
    min-width: 200px;
}

.section-header h2 {
    font-size: 26px;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 8px 0 0 0;
    width: 100%;
    line-height: 1.5;
}

.settings-form {
    max-width: 700px;
}

.account-actions {
    padding: 12px 0;
}

.account-actions .btn {
    width: auto;
    min-width: 120px;
}

/* Improved button styles */
.btn-danger {
    background-color: var(--danger-color);
    color: white;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Enhanced form inputs */
.settings-form .form-group input,
.settings-form .form-group textarea {
    transition: all 0.2s;
}

.settings-form .form-group input:focus,
.settings-form .form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

/* Section spacing */
.settings-section + .settings-section {
    margin-top: 24px;
}

/* Enhanced note cards in settings */
.settings-section .note-card {
    border-left: 4px solid var(--primary-color);
}

/* Icon enhancements */
.section-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Admin Subsection */
.admin-subsection {
    margin-top: 24px;
}

.admin-subsection h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.admin-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.users-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background);
}

.users-table thead {
    background: linear-gradient(to bottom, #e8f0fe 0%, #e3edff 100%);
    border-bottom: 2px solid #3b82f6;
}

.users-table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    border-bottom: 2px solid var(--border-color);
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.users-table tbody tr {
    transition: background-color 0.2s;
}

.users-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-user {
    background-color: #e0f2fe;
    color: #1e3a8a;
}

/* Responsive - Tablet and below */
@media (max-width: 1024px) {
    .container {
        padding: 24px;
    }

    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .settings-section {
        padding: 28px 24px;
    }
}

/* Responsive - Tablet and Mobile (for login card centering) */
@media (max-width: 900px) {
    html, body {
        height: 100%;
    }
    
    .container {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        height: 100vh;
        padding: 16px;
    }

    .login-card {
        margin: 0 !important;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    html, body {
        height: 100%;
    }
    
    .container {
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        height: 100vh;
    }

    .login-card {
        margin: 0 !important;
        padding: 28px 20px;
        width: 100%;
        max-width: 420px;
    }

    .login-card::after {
        width: 20px;
        height: 24px;
        top: 12px;
        right: 16px;
    }

    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        margin-left: -16px;
        margin-right: -16px;
        margin-top: -16px;
        border-radius: 0;
        margin-bottom: 20px;
    }

    .dashboard-header > div:first-child {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .dashboard-header h1 {
        font-size: 20px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-name {
        font-size: 12px;
        margin-top: 4px;
        line-height: 1.4;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        margin-top: 0;
    }

    .header-actions .btn {
        padding: 8px;
        font-size: 12px;
        min-height: 36px;
        min-width: 36px;
        width: auto;
        white-space: nowrap;
        justify-content: center;
    }

    .header-actions .btn .btn-text {
        display: none;
    }

    .header-actions .btn .btn-icon {
        font-size: 18px;
        margin: 0;
        line-height: 1;
    }

    .notes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .note-card {
        padding: 20px;
    }

    .note-title {
        font-size: 18px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-width: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .users-table-container {
        font-size: 12px;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .users-table {
        min-width: 600px;
    }

    .users-table th,
    .users-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .settings-section {
        padding: 24px 16px;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .section-header > div:first-child {
        width: 100%;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .empty-state {
        padding: 60px 16px;
    }

    .empty-state p {
        font-size: 14px;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    html, body {
        height: 100%;
    }
    
    .container {
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        height: 100vh;
    }

    .login-card {
        margin: 0;
        padding: 24px 16px;
        width: 100%;
        max-width: 420px;
    }

    .login-card::after {
        width: 18px;
        height: 22px;
        top: 10px;
        right: 12px;
    }

    .login-card h1 {
        font-size: 28px;
    }

    .dashboard-header {
        padding: 8px 12px;
        margin-left: -12px;
        margin-right: -12px;
        margin-top: -12px;
        margin-bottom: 16px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .dashboard-header h1 {
        font-size: 18px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-name {
        font-size: 10px;
        margin-top: 2px;
        opacity: 0.85;
        display: block;
    }

    .dashboard-header > div:first-child {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .header-actions {
        flex-shrink: 0;
        gap: 6px;
        margin-top: 0;
    }

    .header-actions .btn {
        padding: 8px;
        font-size: 11px;
        min-height: 36px;
        min-width: 36px;
        width: auto;
        white-space: nowrap;
        justify-content: center;
    }

    .header-actions .btn .btn-text {
        display: none;
    }

    .header-actions .btn .btn-icon {
        font-size: 18px;
        margin: 0;
        line-height: 1;
    }

    .header-actions .btn .btn-text {
        display: none;
    }

    .header-actions .btn .btn-icon {
        font-size: 18px;
        margin: 0;
    }

    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .btn-small {
        padding: 5px 10px;
        font-size: 11px;
    }

    .note-card {
        padding: 20px;
        border-radius: 16px;
        border-left-width: 3px;
    }

    .note-card:hover {
        box-shadow: 
            0 4px 10px rgba(59, 130, 246, 0.2),
            0 2px 4px rgba(59, 130, 246, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        border-color: #2563eb;
    }

    .note-title {
        font-size: 18px;
        margin-bottom: 12px;
        padding-left: 32px;
        line-height: 1.3;
    }

    .note-icon {
        width: 22px;
        height: 22px;
    }

    .note-card:hover .note-icon {
        filter: drop-shadow(0 2px 4px rgba(30, 64, 175, 0.4));
    }

    .note-card::after {
        width: 16px;
        height: 20px;
        top: 10px;
        right: 12px;
    }

    .note-description {
        font-size: 13px;
        margin-bottom: 16px;
        padding: 10px 12px;
        border-left-width: 2px;
        line-height: 1.7;
    }

    .settings-section {
        padding: 20px 12px;
        border-radius: 10px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .section-description {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .modal-header {
        padding: 20px 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal form {
        padding: 20px 16px;
    }

    .empty-state {
        padding: 40px 12px;
    }

    .admin-subsection {
        margin-top: 20px;
    }

    .admin-subsection h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-small {
        min-height: 36px;
    }

    .note-card {
        cursor: pointer;
    }

    .note-card:active {
        transform: scale(0.98);
    }

    .close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Folder Styles - Notes/Folder Appearance */
.folder-card {
    background-image: 
        /* Left edge shadow for depth */
        linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.08) 1px, transparent 3px),
        /* Subtle vertical crease lines */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.015) 40px,
            rgba(0, 0, 0, 0.015) 41px
        ),
        /* Main folder gradient */
        linear-gradient(135deg, #fef9e7 0%, #fef3c7 25%, #fde68a 50%, #fef3c7 75%, #fef9e7 100%);
    padding: 32px 24px;
    border-radius: 8px 8px 12px 12px;
    box-shadow: 
        /* Outer shadows */
        0 8px 16px -4px rgba(0, 0, 0, 0.15),
        0 4px 8px -2px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        /* Inner highlights and shadows for depth */
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        inset 3px 0 0 rgba(0, 0, 0, 0.05),
        /* Subtle inner shadow suggesting papers inside */
        inset 0 0 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-top: 3px solid rgba(217, 119, 6, 0.45);
    border-left: 2px solid rgba(217, 119, 6, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    transform-style: preserve-3d;
}

/* Folder tab at top */
.folder-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 24px;
    right: 24px;
    height: 18px;
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.35) 0%, rgba(217, 119, 6, 0.2) 50%, rgba(217, 119, 6, 0.15) 100%);
    border-radius: 10px 10px 0 0;
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-bottom: none;
    box-shadow: 
        0 -3px 6px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    /* Subtle tab highlight */
    background-image: 
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, rgba(217, 119, 6, 0.35) 0%, rgba(217, 119, 6, 0.2) 50%, rgba(217, 119, 6, 0.15) 100%);
}

/* Paper texture overlay and subtle details */
.folder-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Subtle paper grain texture */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(0, 0, 0, 0.008) 8px,
            rgba(0, 0, 0, 0.008) 16px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 8px,
            rgba(0, 0, 0, 0.008) 8px,
            rgba(0, 0, 0, 0.008) 16px
        ),
        /* Subtle aging spots */
        radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.015) 0%, transparent 40%),
        /* Subtle fold/crease shadows */
        linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.02) 30%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.folder-card:hover {
    transform: translateY(-6px) rotateX(2deg);
    box-shadow: 
        0 20px 40px -8px rgba(0, 0, 0, 0.2),
        0 12px 24px -6px rgba(0, 0, 0, 0.15),
        0 4px 8px -2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        inset 3px 0 0 rgba(0, 0, 0, 0.08),
        inset 0 0 25px rgba(0, 0, 0, 0.04);
    border-color: rgba(217, 119, 6, 0.35);
    border-top-color: rgba(217, 119, 6, 0.55);
    border-left-color: rgba(217, 119, 6, 0.4);
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.08) 1px, transparent 3px),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.02) 40px,
            rgba(0, 0, 0, 0.02) 41px
        ),
        linear-gradient(135deg, #fef9e7 0%, #fef3c7 25%, #fde68a 50%, #fef3c7 75%, #fef9e7 100%);
}

.folder-card:hover::before {
    background-image: 
        linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, rgba(217, 119, 6, 0.45) 0%, rgba(217, 119, 6, 0.3) 50%, rgba(217, 119, 6, 0.2) 100%);
    box-shadow: 
        0 -4px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    border-color: rgba(217, 119, 6, 0.4);
}

.folder-card:active {
    transform: translateY(-2px) rotateX(1deg);
}

.folder-icon {
    font-size: 64px;
    margin-bottom: 18px;
    display: block;
    text-align: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)) drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.folder-card:hover .folder-icon {
    transform: scale(1.08) rotate(3deg);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2)) drop-shadow(0 3px 6px rgba(245, 158, 11, 0.4));
}

.folder-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #78350f;
    text-align: center;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    letter-spacing: -0.02em;
}

.folder-meta {
    text-align: center;
    padding-top: 14px;
    position: relative;
    z-index: 1;
}

.folder-meta small {
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(217, 119, 6, 0.15);
    padding: 5px 14px;
    border-radius: 14px;
    display: inline-block;
    border: 1px solid rgba(217, 119, 6, 0.2);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--card-background);
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-item:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-hover);
}

.breadcrumb-item span {
    font-size: 16px;
    flex-shrink: 0;
}

.breadcrumb-separator {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Mobile responsive styles for breadcrumb */
@media screen and (max-width: 768px) {
    .breadcrumb {
        padding: 12px;
        gap: 6px;
        margin-bottom: 20px;
        border-radius: 6px;
    }
    
    .breadcrumb-item {
        font-size: 13px;
        padding: 5px 10px;
        gap: 4px;
    }
    
    .breadcrumb-item span {
        font-size: 14px;
    }
    
    .breadcrumb-separator {
        font-size: 12px;
        margin: 0 2px;
    }
}

@media screen and (max-width: 480px) {
    .breadcrumb {
        padding: 6px 8px;
        gap: 3px;
        margin-bottom: 10px;
        border-radius: 4px;
        box-shadow: none;
        border-width: 1px;
    }
    
    .breadcrumb-item {
        font-size: 11px;
        padding: 2px 6px;
        gap: 2px;
        line-height: 1.1;
    }
    
    .breadcrumb-item span {
        font-size: 12px;
    }
    
    .breadcrumb-separator {
        font-size: 10px;
        margin: 0 2px;
    }
    
    /* Hide "Root" text on very small screens, keep icon only */
    .breadcrumb-item:first-child {
        padding: 2px 4px;
    }

    /* Let the last (current) breadcrumb item show more text but end with ellipsis when too long */
    .breadcrumb-item:last-child {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }

    /* Earlier breadcrumb items stay compact with ellipsis */
    .breadcrumb-item:not(:last-child) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
}

/* Folder List in Settings */
.folders-list {
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
}

.folder-item {
    transition: background-color 0.2s;
    min-width: 0; /* Allow flex items to shrink */
}

.folder-item:hover {
    background: rgba(79, 70, 229, 0.05) !important;
}

.folder-item-nested {
    background: linear-gradient(to right, rgba(217, 119, 6, 0.05) 0%, var(--background) 10px) !important;
}

.folder-item-nested:hover {
    background: linear-gradient(to right, rgba(217, 119, 6, 0.08) 0%, rgba(79, 70, 229, 0.05) 10px) !important;
}

/* Mobile responsive styles for folders list */
@media screen and (max-width: 768px) {
    .folders-list {
        max-height: none;
        overflow-y: visible;
    }
    
    .folder-item {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 12px !important;
        gap: 12px;
    }
    
    .folder-item > div:first-child {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    
    .folder-item strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        word-break: break-word;
    }
    
    .folder-item > div:last-child {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .folder-item > div:last-child .btn {
        flex: 1;
        min-width: 100px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Reduce nested folder indentation on mobile */
    .folder-item[style*="margin-left"] {
        margin-left: 16px !important;
    }
    
    /* Adjust nested folder border for mobile */
    .folder-item[style*="border-left"] {
        border-left-width: 2px !important;
        padding-left: 12px !important;
    }
    
    /* Make nested badge wrap better */
    .folder-item span[style*="Nested"] {
        display: inline-block;
        margin-top: 4px;
        white-space: nowrap;
    }
}

@media screen and (max-width: 480px) {
    .folder-item {
        padding: 10px !important;
    }
    
    .folder-item strong {
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .folder-item > div:last-child {
        flex-direction: column;
        width: 100%;
    }
    
    .folder-item > div:last-child .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Further reduce indentation for very small screens */
    .folder-item[style*="margin-left"] {
        margin-left: 12px !important;
    }
    
    /* Hide arrow on very small screens to save space */
    .folder-item span[style*="└─"] {
        font-size: 12px;
        margin-right: 4px;
    }
    
    /* Make nested badge smaller */
    .folder-item span[style*="Nested"] {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Print styles */
@media print {
    .dashboard-header,
    .header-actions,
    .note-actions,
    .settings-section:first-of-type,
    .admin-subsection {
        display: none;
    }

    .note-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .folder-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

