body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: #0f172a; /* dark background */
    color: #e5e7eb;
}

body.login-bg {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, #27495e 0%, #0d1320 40%, #090b12 100%);
}

body.dashboard-bg {
   background: radial-gradient(circle at 20% 20%, #27495e 0%, #0d1320 40%, #090b12 100%);
}

.login-box {
    background: rgba(17, 24, 39, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 32px 28px;
    width: min(360px, 95vw);
    backdrop-filter: blur(6px);
    color: #e5e7eb;
}

.login-box h2 {
    margin: 0 0 18px;
    font-size: 1.7rem;
    letter-spacing: 0.5px;
    text-align: center;
    color: #f8fafc;
}

.login-box p.error {
    margin: 0 0 14px;
    color: #fecaca;
    background: rgba(254, 202, 202, 0.25);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-box .input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-box input {
    /* width: 100%; */
    padding: 12px 14px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
    color: #e5e7eb;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.login-box button {
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.login-box button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.login-box .secondary {
    color: #93a3b7;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
}

.login-box .secondary a {
    color: #93c5fd;
    text-decoration: none;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.modal-content {
    position: relative;
    width: min(90vw, 1000px);
    height: min(90vh, 800px);
    background: #0d172a;
    border: 2px solid #60a5fa;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.85);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #93c5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, background 0.2s ease;
}

.close-btn:hover {
    background: rgba(37, 99, 235, 0.9);
    transform: scale(1.05);
}

.tiny-btn {
    background: #1f2937;
    border: 1px solid #334155;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.9rem;
    cursor: pointer;
}

.tiny-btn:hover {
    background: #111827;
}

/* LAYOUT */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #111827;
    border-right: 1px solid #1f2937;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: auto;
}
.sidebar h2 {
    margin-bottom: 20px;
    color: #f9fafb;
}

.profile-menu{display: none;}
.profile-name{display: none;}
.profile-menu-btn {display: none;}

.menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
}

.menu a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.menu.active {
    background: #1f2937;
    color: #ffffff;
}

.logout-menu {
    margin-top: 0;
    position: absolute;
    bottom: 60px;
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
}

/* MAIN */
.main {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: auto;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* WELCOME SECTION */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.welcome-text h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    color: #f8fafc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.welcome-text p {
    margin: 0;
    color: #9ca3af;
}

.quick-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: linear-gradient(145deg, #111827, #1f2937);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2563eb;
}

.stat-label {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* TABS SECTION */
.tabs-section {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 12px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
    color: #e5e7eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* DOC GRID */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 50px;
}

.doc-card {
    background: linear-gradient(145deg, #111827, #0f172a);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 18px;
    padding: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 50px;
}

.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.35);
}

.doc-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-icon i {
    font-size: 24px;
    color: #2563eb;
}

.settings-card {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 20px;
    margin-top: 20px;
    max-width: 700px;
}

.settings-card h3 {
    margin: 0 0 14px;
}

.settings-card label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.settings-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    outline: none;
}

.settings-card input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.secondary-btn {
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.secondary-btn:hover {
    background: #111827;
    border-color: #2563eb;
}

/* DESKTOP - Settings always visible */
@media (min-width: 769px) {
    #changePasswordSection {
        display: block !important;
        margin-top: 16px;
    }

    .toggle-password-btn {
        display: none !important;
    }
}

/* MOBILE - Settings hidden by default, toggle button visible */
@media (max-width: 768px) {
    #changePasswordSection {
        display: none;
        margin-top: 16px;
    }

    .toggle-password-btn {
        display: block !important;
    }
}

.doc-info h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: #f8fafc;
    font-weight: 500;
    word-break: break-word;
}

.doc-number {
    margin: 0;
    font-size: 0.85rem;
    color: #22c55e;
    font-family: 'Courier New', monospace;
}

.doc-card-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #334155;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.view-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(100, 116, 139, 0.4);
    background: rgba(37, 99, 235, 0.08);
    border-radius: 12px;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.92rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.view-btn:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: #2563eb;
    transform: translateY(-1px);
}

/* SEARCH */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111827;
    border: 1px solid #334155;
    padding: 12px 14px;
    border-radius: 10px;
    /* width: 100%; */
    margin-bottom: 20px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.search-bar input::placeholder {
    color: #6b7280;
}

/* SEARCH PAGE STYLES */
.search-container {
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111827;
    border: 1.5px solid #334155;
    padding: 12px 14px;
    border-radius: 12px;
    width: 100%;
}

.search-input-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    color: #e5e7eb;
    font-size: 1rem;
}

.search-input-wrapper i:first-child {
    color: #6b7280;
}

.search-input-wrapper .ri-close-line {
    color: #6b7280;
    cursor: pointer;
}

.suggestions-section h3,
.results-section h3 {
    color: #f8fafc;
    font-size: 1rem;
    margin-bottom: 12px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.suggestion-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.suggestion-card:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

.suggestion-card i {
    font-size: 24px;
    color: #2563eb;
    margin-bottom: 6px;
}

.suggestion-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.results-section {
    margin-top: 20px;
}

/* Deprecated styles removed - using new card layout structure */

/* MOBILE NAV */
.mobile-nav {
    display: none;
}

.mobile-header {
    display: none;
}

/* MOBILE */
@media (max-width: 768px){

    .sidebar { display: none; }

    .search-bar {
        display: none;
    }

    .welcome-section {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .quick-stats {
        display: none;
    }

    .tabs-section {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 6px 12px;
    }

    .doc-grid {
        grid-template-columns: 1fr;
        padding-bottom: 120px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 16px;
        left: 16px;
        right: 16px;
        height: 56px;
        background: rgba(17, 24, 39, 0.96);
        border: 1px solid #1f2937;
        border-radius: 20px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
        z-index: 999;
        transition: all 0.3s ease;
        padding: 0 16px;
    }

    .mobile-header:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    }

    .mobile-header h1 {
        margin: 0;
        font-size: 1.15rem;
        color: #f8fafc;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .header-right i {
        font-size: 20px;
        color: #6b7280;
        cursor: pointer;
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .header-right i:hover {
        color: #f8fafc;
        transform: translateY(-1px);
    }

    .profile-menu {
        display: none;
        position: fixed;
        top: 80px;
        right: 16px;
        background: rgba(17, 24, 39, 0.96);
        border: 1px solid #1f2937;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
        padding: 12px;
        z-index: 1000;
        min-width: 140px;
    }

    .profile-name {
        display: block;
        color: #f8fafc;
        font-size: 0.9rem;
        margin-bottom: 8px;
        text-align: center;
    }

    .profile-menu-btn {
        display: block;
        background: #2563eb;
        color: white;
        border: none;
        border-radius: 6px;
        padding: 6px 12px;
        cursor: pointer;
        width: 100%;
        font-size: 0.85rem;
    }

    .profile-menu-btn:hover {
        background: #1d4ed8;
    }

    .layout {
        margin-top: 88px;
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 16px;
        left: 16px;
        right: 16px;
        background: rgba(17, 24, 39, 0.96);
        border: 1px solid #1f2937;
        border-radius: 20px;
        justify-content: space-around;
        align-items: center;
        padding: 12px 16px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
        z-index: 999;
    }

    .mobile-nav a {
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    .mobile-nav i {
        font-size: 20px;
        color: #6b7280;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .mobile-nav a:hover i {
        color: #e5e7eb;
    }

    .mobile-nav .active {
        color: #2563eb;
    }
}