/* ============================================
   HouseManager - Premium SaaS Dashboard CSS
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: rgba(67, 97, 238, 0.12);
    --success: #2ec4b6;
    --success-light: rgba(46, 196, 182, 0.12);
    --warning: #ff9f1c;
    --warning-light: rgba(255, 159, 28, 0.12);
    --danger: #e71d36;
    --danger-light: rgba(231, 29, 54, 0.12);
    --info: #4cc9f0;
    --info-light: rgba(76, 201, 240, 0.12);
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: rgba(67, 97, 238, 0.2);
    --sidebar-width: 260px;
    --content-bg: #f0f2f5;
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --text-light: rgba(255, 255, 255, 0.7);
    --border: #e9ecef;
    --topbar-height: 60px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: 0.2s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--content-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
}

/* ---------- Layout ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.sidebar-toggle i {
    width: 22px;
    height: 22px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.sidebar-close i {
    width: 20px;
    height: 20px;
    color: rgba(255,255,255,0.5);
}

.sidebar-close:hover i {
    color: #fff;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-bottom: 10px;
}

.user-info i {
    width: 18px;
    height: 18px;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    padding: 8px 0;
    transition: color 0.2s;
}

.logout-link:hover {
    color: var(--danger);
}

.logout-link i {
    width: 18px;
    height: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav li a i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: rgba(255, 255, 255, 0.15);
}

.sidebar-nav li.active a {
    background: var(--sidebar-active);
    color: var(--white);
    border-left-color: var(--primary);
}

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

/* --- h1 / h2 --- */
h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1 i {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2 i {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

/* --- Form elements in cards --- */
.card input[type="text"],
.card input[type="number"],
.card input[type="email"],
.card input[type="password"],
.card input[type="date"],
.card input[type="time"],
.card select,
.card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-dark);
    background: var(--white);
    transition: all var(--transition);
    box-sizing: border-box;
}

.card input:focus,
.card select:focus,
.card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.card p {
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: var(--content-bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(67, 97, 238, 0.03);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Responsive sidebar --- */
@media (max-width: 992px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar-close {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header .logo-icon i {
    color: var(--white);
    width: 22px;
    height: 22px;
}

.sidebar-header h2 {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav .nav-section {
    padding: 8px 24px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav a i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: rgba(255, 255, 255, 0.15);
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar-nav a.active i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    padding: 8px 0;
    transition: color var(--transition);
}

.sidebar-footer a:hover {
    color: var(--danger);
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.hamburger:hover {
    background: var(--content-bg);
}

.hamburger i {
    width: 24px;
    height: 24px;
    color: var(--text-dark);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-right .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
}

.topbar-right .user-name {
    font-weight: 600;
    font-size: 14px;
}

.topbar-right .user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Content Area ---------- */
.content,
.content-area {
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-4 {
    margin-top: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ---------- Stats Cards ---------- */
.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--primary);
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }
.stat-card.primary { border-left-color: var(--primary); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.primary .stat-icon i { color: var(--primary); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.success .stat-icon i { color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.warning .stat-icon i { color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.danger .stat-icon i { color: var(--danger); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }
.stat-card.info .stat-icon i { color: var(--info); }

.stat-card .stat-info h4 {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
}

.stat-card .stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-family);
    line-height: 1.4;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-sm i {
    width: 16px;
    height: 16px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #25a99d;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(46, 196, 182, 0.35);
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #c5192e;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(231, 29, 54, 0.35);
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: #e68a00;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 10px;
}

.btn-ghost:hover {
    background: var(--content-bg);
    color: var(--text-dark);
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-dark);
    background: var(--white);
    transition: all var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: #adb5bd;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: var(--content-bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

table tbody tr {
    transition: background var(--transition);
}

table tbody tr:hover {
    background: rgba(67, 97, 238, 0.03);
}

table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

table tbody tr:nth-child(even):hover {
    background: rgba(67, 97, 238, 0.03);
}

table .actions {
    display: flex;
    gap: 6px;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: #2196f3;
}

.badge-gray {
    background: #f1f3f5;
    color: var(--text-muted);
}

/* Priority badges */
.badge-priority-low {
    background: #f1f3f5;
    color: var(--text-muted);
}

.badge-priority-medium {
    background: #fff3cd;
    color: #856404;
}

.badge-priority-high {
    background: #ff9f1c;
    color: var(--white);
}

.badge-priority-urgent {
    background: var(--danger);
    color: var(--white);
}

/* ---------- Flash Messages ---------- */
.flash-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.flash-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.flash-message.error {
    background: #fde8ea;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.flash-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

.flash-message.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.flash-message .flash-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.flash-message .flash-close:hover {
    opacity: 1;
}

.flash-message .flash-close i {
    width: 16px;
    height: 16px;
}

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--content-bg);
}

.modal-close i {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- Progress Bar ---------- */
.progress-bar-container {
    margin-bottom: 16px;
}

.progress-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.progress-bar-header .label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.progress-bar-header .value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--info));
    transition: width 0.6s ease;
}

.progress-bar .fill.success {
    background: linear-gradient(90deg, var(--success), #25a99d);
}

.progress-bar .fill.warning {
    background: linear-gradient(90deg, var(--warning), #ffb84d);
}

.progress-bar .fill.danger {
    background: linear-gradient(90deg, var(--danger), #ff4d6a);
}

/* ---------- Chart Container ---------- */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 350px;
    padding: 8px 0;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 320px;
}

/* ---------- Scrollable ---------- */
.scrollable {
    overflow-y: auto;
    max-height: 400px;
}

.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 6px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ---------- Shopping List (Checkbox) ---------- */
.shopping-list {
    list-style: none;
    padding: 0;
}

.shopping-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.shopping-list li:last-child {
    border-bottom: none;
}

.shopping-list li label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
}

.shopping-list input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition);
}

.shopping-list input[type="checkbox"]:checked {
    background: var(--success);
    border-color: var(--success);
}

.shopping-list input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.shopping-list li.checked span {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ---------- Calendar Grid ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid .day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 0;
    text-transform: uppercase;
}

.calendar-grid .day-cell {
    min-height: 80px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 13px;
    transition: all var(--transition);
}

.calendar-grid .day-cell:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.calendar-grid .day-cell .day-number {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.calendar-grid .day-cell.other-month .day-number {
    color: #ced4da;
}

.calendar-grid .day-cell.today {
    background: var(--primary-light);
    border-color: var(--primary);
}

.calendar-grid .day-cell.today .day-number {
    color: var(--primary);
    font-weight: 800;
}

.calendar-grid .day-cell .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
    margin-right: 4px;
}

/* ---------- Meal Planner ---------- */
.meal-planner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.meal-planner-table thead th {
    background: var(--primary);
    color: var(--white);
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

.meal-planner-table thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
    text-align: left;
    padding-left: 16px;
}

.meal-planner-table thead th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.meal-planner-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: top;
}

.meal-planner-table tbody td:first-child {
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
    padding-left: 16px;
    white-space: nowrap;
}

.meal-planner-table tbody tr:hover {
    background: var(--primary-light);
}

.meal-planner-table .meal-item {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Timeline / Task List ---------- */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.completed::before {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}

.timeline-item.overdue::before {
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--danger);
}

.timeline-item .timeline-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.timeline-item .timeline-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-item .timeline-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.timeline-item .timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-item .timeline-date i {
    width: 14px;
    height: 14px;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    width: 64px;
    height: 64px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

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

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.font-bold { font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .stats-row {
        gap: 16px;
    }

    .stat-card {
        min-width: 180px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .form-row {
        flex-direction: column;
    }

    .calendar-grid .day-cell {
        min-height: 60px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .content {
        padding: 16px;
    }

    .stats-row {
        flex-direction: column;
        gap: 12px;
    }

    .stat-card {
        min-width: auto;
    }

    .card {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-title {
        font-size: 17px;
    }

    .topbar-right .user-name,
    .topbar-right .user-role {
        display: none;
    }

    .modal {
        margin: 10px;
        max-height: 85vh;
    }

    .calendar-grid {
        font-size: 11px;
    }

    .calendar-grid .day-cell {
        min-height: 50px;
        padding: 4px;
    }

    .meal-planner-table {
        font-size: 11px;
    }

    .meal-planner-table thead th,
    .meal-planner-table tbody td {
        padding: 8px 4px;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 32px 24px;
        margin: 12px;
    }

    .stats-row .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .table-responsive {
        font-size: 12px;
    }

    .flash-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .flash-message {
        min-width: auto;
    }

    .btn-group-responsive {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }
}

/* === Kanban Board === */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.kanban-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* === Progress Bar === */
.progress-bar-wrap {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 6px 0;
}

.progress-bar {
    height: 100%;
    background: #4361ee;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-complete {
    background: #2ec4b6;
}

/* === Goals Grid === */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.goal-card .goal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.goal-card .goal-icon {
    font-size: 24px;
}

.goal-card .goal-amounts {
    font-size: 14px;
    color: #555;
    margin: 6px 0;
}

.goal-card .goal-deadline {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.goal-card .goal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

/* === Page Title === */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a2e;
}

/* === Stats Row === */
.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #4361ee;
}

.stat-card.success { border-left-color: #2ec4b6; }
.stat-card.danger { border-left-color: #e71d36; }
.stat-card.warning { border-left-color: #ff9f1c; }
.stat-card.info { border-left-color: #4cc9f0; }
.stat-card.primary { border-left-color: #4361ee; }

.stat-card .stat-info h4 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1a1a2e;
}

.stat-card .stat-info p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

/* === Form Controls (override if needed) === */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* === Filter Tabs === */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f3f5;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.filter-tab:hover {
    background: #e9ecef;
    color: #333;
}

.filter-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === Shopping Item === */
.shopping-item {
    padding: 14px 18px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.shopping-item.item-checked {
    opacity: 0.55;
}

.shopping-item-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toggle-form {
    display: inline-flex;
}

.custom-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.custom-checkbox i {
    width: 16px;
    height: 16px;
    color: #fff;
}

.custom-checkbox:hover {
    border-color: var(--success);
    background: rgba(46, 196, 182, 0.08);
}

.custom-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.item-name-checked {
    text-decoration: line-through;
    color: var(--text-muted);
}

.item-details {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.item-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.priority-gray {
    background: #f1f3f5;
    color: #868e96;
}

.priority-yellow {
    background: #fff3cd;
    color: #856404;
}

.priority-red {
    background: #ff6b6b;
    color: #fff;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
}

.delete-form {
    display: inline-flex;
    flex-shrink: 0;
}

.btn-delete {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #adb5bd;
}

.btn-delete i {
    width: 18px;
    height: 18px;
}

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

.category-group {
    margin-bottom: 24px;
}

.category-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 4px;
}

.action-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-bar-top {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.action-bar-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.items-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.progress-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #dee2e6;
    color: #333;
}

/* === Work Schedule === */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    margin-bottom: 20px;
}

.calendar-nav-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.calendar-header {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-weekend {
    color: var(--danger);
}

.calendar-cell {
    min-height: 90px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    transition: all 0.2s ease;
}

.calendar-cell:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.calendar-cell-empty {
    background: #fafafa;
    border-color: #f1f3f5;
}

.calendar-cell-today {
    background: var(--primary-light);
    border-color: var(--primary);
}

.calendar-cell-weekend {
    background: #fff8f8;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.calendar-cell-today .calendar-day-number {
    color: var(--primary);
    font-weight: 800;
}

.calendar-shifts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shift-block {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    line-height: 1.3;
}

.shift-delete-form {
    display: inline-flex;
}

.shift-delete-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.shift-delete-btn:hover {
    color: #fff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 12px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .kanban-board { grid-template-columns: 1fr; }
    .goals-grid { grid-template-columns: 1fr; }
    .stats-row { flex-direction: column; }
    .form-row { flex-direction: column; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .calendar-cell { min-height: 60px; }
}
