/* style.css - Modern, Premium Dashboard Theme */
:root {
    --primary: #2b59ff;
    --primary-light: #eef2ff;
    --bg-page: #f8f9fc;
    --bg-card: #ffffff;
    --sidebar-bg: #ffffff;
    --text-main: #1a202c;
    --text-muted: #718096;
    --border: #edf2f7;
    --success: #38a169;
    --danger: #e53e3e;
    --accent: #ed8936;
    --sidebar-width: 250px;
    --header-height: 70px;
    --shadow-sm: 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);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 100;
}

.sidebar h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.sidebar .nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.75rem 0.5rem;
    font-weight: 600;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary);
    color: #ffffff;
}

/* Main Layout */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.navbar {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}


.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}


.navbar .user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.navbar .user-avatar {
    width: 35px;
    height: 35px;
    background: #eee;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Area */
.content-wrapper {
    padding: 2rem;
}

.welcome-header {
    margin-bottom: 2rem;
}

.welcome-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.welcome-header p {
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.stat-card:hover { border-color: var(--primary); }

.stat-card .icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Generic Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

tr:hover td {
    background-color: #fafbfc;
}

/* Buttons */
.btn, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1a44e6; transform: translateY(-1px); }

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

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #def7ec; color: #03543f; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fde8e8; color: #9b1c1c; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
    background-color: #f9fafb;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    background-color: #ffffff;
}

.grid { display: grid; gap: 1.5rem; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
.grid-cols-1 { grid-template-columns: 1fr; }

/* Details/Accordion */
details {
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary);
    outline: none;
}

/* User Info in Sidebar Fix */
.sidebar .user-info {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.sidebar .user-info a {
    color: var(--danger);
    font-weight: 600;
}

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #f8f9fc 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100vh;
}

.login-box {
    background: #ffffff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(43, 89, 255, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
    margin: auto;
}

.login-box h2 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.login-box .form-group {
    text-align: left;
}

.login-box .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: none !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loader-overlay.active {
    display: flex !important;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-light);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.loader-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.section-header i {
    font-size: 1.25rem;
}

.section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-section .grid {
    margin-top: 1rem;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Strength Meter */
.strength-meter {
    height: 4px;
    background: #e2e8f0;
    margin-top: 0.5rem;
    border-radius: 2px;
    overflow: hidden;
}

.strength-meter-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
    font-weight: 600;
}

.strength-weak { background-color: #ef4444; width: 25%; }
.strength-fair { background-color: #f59e0b; width: 50%; }
.strength-good { background-color: #3b82f6; width: 75%; }
.strength-strong { background-color: #10b981; width: 100%; }

.text-weak { color: #ef4444; }
.text-fair { color: #f59e0b; }
.text-good { color: #3b82f6; }
.text-strong { color: #10b981; }
