:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #3b82f6;
    --danger: #dc2626;
    --text: #1e293b;
    --text-light: #64748b;
    --background: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.95);
    --glass-hover: rgba(255, 255, 255, 1);
    --glass-border: rgba(255, 255, 255, 0.25);
    --sidebar-bg: rgba(30, 41, 59, 0.98);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 4px rgba(148, 163, 184, 0.1);
    --shadow-md: 0 4px 6px rgba(148, 163, 184, 0.15);
    --shadow-lg: 0 8px 16px rgba(148, 163, 184, 0.2);
    --primary-solid: #2563eb;
    --primary-dark: #1d4ed8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* === LOGIN STYLES === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(120deg, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%);
}

.login-container {
    display: flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
}

.login-image {
    flex: 1;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.3)),
        url('https://images.unsplash.com/photo-1748002388689-c62b45d5c28b?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.login-image h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-image p {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
}

.login-form {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
}

.logo-container {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(37, 99, 235, 0.1);
}

.logo-container h1 {
    color: var(--text);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-solid) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-container p {
    color: var(--text-light);
    font-size: 1rem;
    opacity: 0.8;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-solid);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.login-btn {
    background: var(--primary-solid);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.error-message {
    background: rgba(254, 226, 226, 0.9);
    color: var(--danger);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(220, 38, 38, 0.2);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

/* === DASHBOARD STYLES === */
.dashboard-body {
    display: flex;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    min-height: 100vh;
    color: white;
    padding: 1rem;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    z-index: 1100;
}

.sidebar-header {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.department-list {
    list-style: none;
    flex-grow: 1;
}

.department-item {
    margin-bottom: 0.5rem;
    position: relative;
}

.department-name {
    padding: 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.department-name:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.department-name::after {
    content: '→';
    opacity: 0;
    transition: all 0.3s ease;
}

.department-name:hover::after {
    opacity: 1;
    transform: translateX(5px);
}

.department-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: rgba(52, 73, 94, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    width: 220px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    z-index: 9999;
}

.department-menu a {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.department-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.admin-section {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.admin-menu {
    list-style: none;
}

.admin-menu li {
    margin-bottom: 0.5rem;
}

.admin-menu a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}

.admin-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    width: calc(100% - 280px);
    position: relative;
    z-index: 1000;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info h1 {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
}

.user-role {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.section {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.section:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title::after {
    content: '';
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-left: 1rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.document-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.document-card:hover {
    transform: translateY(-5px);
    background: var(--glass-hover);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
}

.document-card h3 {
    color: var(--text);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    border-bottom: 2px solid rgba(59, 130, 246, 0.1);
    padding-bottom: 1rem;
}

.document-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.document-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-info p::before {
    content: '•';
    color: var(--accent);
    font-weight: bold;
}

.document-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.document-actions a,
.view-btn {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.view-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
    width: 100%;
    text-align: center;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.search-bar {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-family: inherit;
    background: var(--glass);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.search-bar:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* === PROFILE STYLES === */
.profile-container {
    width: 100%;
    max-width: 500px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

.profile-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(120deg, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%);
}

.is-invalid {
    border-color: var(--danger) !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger);
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .documents-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        flex-direction: column;
    }

    .login-image {
        min-height: 300px;
    }

    .login-form {
        padding: 2rem;
    }
}

/* === VIEW TOGGLE STYLES === */
.search-and-toggle {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.view-toggles {
    display: flex;
    background: var(--glass);
    padding: 0.25rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.view-btn-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.view-btn-toggle.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === LIST VIEW STYLES === */
.documents-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.list-view .document-card {
    flex-direction: row;
    align-items: center;
    padding: 1.5rem 2rem;
    gap: 2rem;
}

.list-view .document-card:hover {
    transform: translateY(-2px);
}

.list-view .document-card h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    width: 30%;
    min-width: 250px;
}

.list-view .document-info {
    flex-grow: 1;
    margin-bottom: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.list-view .document-info p {
    margin: 0;
}

.list-view .document-actions {
    margin-top: 0;
    min-width: 180px;
}

/* Responsive List View */
@media (max-width: 900px) {
    .list-view .document-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .list-view .document-card h3 {
        width: 100%;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 0.5rem;
    }

    .list-view .document-info {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .list-view .document-actions {
        width: 100%;
        margin-top: 1rem;
    }
}