:root {
    --sidebar-width: 250px;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: #2d2a6e;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --bg-body: #f5f6fa;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    font-size: 14.5px;
}

a { text-decoration: none; }

/* ---------------- Auth Pages ---------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
}

.auth-card .brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-card .brand i {
    font-size: 34px;
    color: var(--primary);
}

.auth-card h4 {
    font-weight: 600;
    margin-top: 8px;
}

.auth-card .form-label { font-weight: 500; font-size: 13px; }

.btn-primary-app {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}
.btn-primary-app:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* ---------------- Layout ---------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 17px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { color: var(--primary); font-size: 20px; }

.sidebar-nav {
    list-style: none;
    padding: 14px 12px;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav li a i { width: 18px; text-align: center; }

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav li.active a {
    background: var(--primary);
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-weight: 600;
    font-size: 16px;
}

.btn-toggle-sidebar {
    background: var(--primary-light);
    border: none;
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.btn-user-menu {
    background: transparent;
    border: none;
    font-weight: 500;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.page-content {
    padding: 26px;
    flex: 1;
}

/* ---------------- Cards ---------------- */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue { background: #eef2ff; color: #4f46e5; }
.stat-icon.green { background: #ecfdf5; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #d97706; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.content-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.content-card .card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.content-card h5 {
    font-weight: 600;
    margin: 0;
}

table.dataTable thead th {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color) !important;
}

table.dataTable td { vertical-align: middle; font-size: 13.5px; }

.badge-property-exterior { background: #ecfdf5; color: #16a34a; font-weight: 500; }
.badge-property-interior { background: #eef2ff; color: #4f46e5; font-weight: 500; }
.badge-status-active { background: #ecfdf5; color: #16a34a; font-weight: 500; }
.badge-status-inactive { background: #fef2f2; color: #dc2626; font-weight: 500; }
.badge-role-admin { background: #fff7ed; color: #d97706; font-weight: 500; }
.badge-role-client { background: #eef2ff; color: #4f46e5; font-weight: 500; }

.form-label { font-weight: 500; font-size: 13.5px; }

.password-toggle-wrap { position: relative; }
.password-toggle-wrap .toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
