/* ============================================
   BERISHA - Mobile-First Native App Design
   ============================================ */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #93bbfd;
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #22c55e;
    --success-bg: #dcfce7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --purple: #8b5cf6;
    --purple-bg: #ede9fe;
    --orange: #f97316;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --header-h: 56px;
    --bottom-nav-h: 68px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-lighter); border-radius: 4px; }

/* ============================================
   AUTH PAGES (Login / Signup)
   ============================================ */
.auth-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-main {
    width: 100%;
    padding: 20px;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 40px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(59,130,246,0.4));
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.auth-logo p {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-top: 4px;
}

.auth-card .form-group {
    margin-bottom: 16px;
}

.auth-card .input-icon {
    position: relative;
}

.auth-card .input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 16px;
    z-index: 1;
}

.auth-card .input-icon input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.auth-card .input-icon input::placeholder {
    color: rgba(255,255,255,0.3);
}

.auth-card .input-icon input:focus {
    border-color: var(--primary);
    background: rgba(59,130,246,0.08);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    transition: var(--transition);
}

.menu-btn:active {
    transform: scale(0.92);
    background: var(--border);
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

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

/* Language Toggle (header) */
.lang-toggle {
    display: flex;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid #00000040;
    background: rgba(255,255,255,0.12);
    color: black;
}
.lang-btn {
    padding: 5px 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #000000;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.7;
}
.lang-btn.active {
    background: var(--primary);
    color: #fff;
    opacity: 1;
}
.lang-btn:not(.active):hover {
    background: rgba(255,255,255,0.25);
    opacity: 1;
}

/* Auth page language toggle */
.auth-lang-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg);
}
.auth-lang-toggle .lang-btn {
    padding: 6px 18px;
    font-size: 12px;
    color: var(--text);
    background: var(--border-light);
    opacity: 1;
}
.auth-lang-toggle .lang-btn.active {
    background: var(--primary);
    color: #fff;
}
.auth-lang-toggle .lang-btn:not(.active):hover {
    background: var(--border);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.user-badge i {
    font-size: 22px;
    color: var(--primary);
}

.user-name {
    display: none;
}

.role-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
}

.role-tag.admin {
    background: var(--purple);
}

/* ============================================
   SIDEBAR / NAVIGATION DRAWER
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #fff;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.sidebar-logo i {
    font-size: 24px;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 16px;
}

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

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a:active {
    background: var(--bg);
    color: var(--text);
}

.sidebar-nav a.active {
    background: rgba(59,130,246,0.1);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a i {
    width: 22px;
    text-align: center;
    font-size: 17px;
}

.nav-divider {
    padding: 16px 16px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-lighter);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--danger);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    transition: var(--transition);
}

.logout-btn:active {
    background: var(--danger-bg);
}

.install-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    margin-bottom: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.install-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #059669);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    margin-bottom: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.share-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.install-guide h4 {
    margin: 0 0 16px;
    color: var(--text);
}

.install-guide ol {
    padding-left: 20px;
    margin: 0 0 12px;
}

.install-guide ol li {
    padding: 6px 0;
    color: var(--text-light);
    line-height: 1.5;
}

.install-guide ol li strong {
    color: var(--text);
}

/* Install Banner (Bottom sheet style) */
.install-banner {
    position: fixed;
    bottom: 70px;
    left: 8px;
    right: 8px;
    z-index: 9999;
    animation: slideBannerUp 0.4s ease-out;
}

@keyframes slideBannerUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(59,130,246,0.15);
}

.install-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-banner-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-text strong {
    display: block;
    font-size: 14px;
    color: var(--text);
    line-height: 1.2;
}

.install-banner-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.install-banner-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.install-banner-btn:active {
    transform: scale(0.95);
    background: #1e40af;
}

.install-banner-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   BOTTOM NAVIGATION (Mobile)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-lighter);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
}

.bottom-nav a i {
    font-size: 20px;
    transition: var(--transition);
}

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

.bottom-nav a.active i {
    transform: scale(1.1);
}

.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.app-main {
    padding-top: calc(var(--header-h) + 8px);
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
    min-height: 100vh;
}

.page-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    color: var(--primary);
    font-size: 20px;
}

.page-subtitle {
    color: var(--text-lighter);
    font-size: 13px;
    margin-top: 2px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

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

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

.card-header h3 i {
    color: var(--primary);
    font-size: 14px;
}

.card-body {
    padding: 16px;
}

.card-body.no-padding {
    padding: 0;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: rgba(59,130,246,0.1); color: var(--primary); }
.stat-green .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-purple .stat-icon { background: var(--purple-bg); color: var(--purple); }
.stat-orange .stat-icon { background: var(--warning-bg); color: var(--orange); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-lighter);
    font-weight: 500;
    margin-top: 2px;
}

/* Small stats */
.stats-small {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-sm {
    padding: 12px;
    gap: 0;
}

.stat-sm .stat-icon { display: none; }
.stat-sm .stat-value { font-size: 18px; }
.stat-sm .stat-label { font-size: 11px; }

/* ============================================
   LIST CARDS
   ============================================ */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition);
}

.list-card:active {
    transform: scale(0.99);
}

.list-card-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
}

.list-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(59,130,246,0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.list-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

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

.list-card-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-info p {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-card-info p i {
    font-size: 11px;
    color: var(--text-lighter);
}

.list-card-arrow {
    color: var(--text-lighter);
    font-size: 14px;
}

.list-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    justify-content: flex-end;
}

.user-actions {
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    justify-content: center;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-full {
    width: 100%;
    padding: 14px 20px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text-light);
}

.btn-icon:active { transform: scale(0.9); }

.btn-edit { color: var(--primary); }
.btn-delete { color: var(--danger); }

.btn-icon-sm {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    background: var(--bg);
    color: var(--text-light);
    transition: var(--transition);
}

.btn-icon-sm:active { transform: scale(0.9); }
.btn-icon-sm.btn-delete { color: var(--danger); }

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-control::placeholder {
    color: var(--text-lighter);
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    margin-bottom: 12px;
}

.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row.two-col .form-group {
    margin-bottom: 0;
}

/* Search bar */
.search-bar {
    margin-bottom: 16px;
}

.search-bar .input-icon {
    position: relative;
}

.search-bar .input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
}

.search-bar .input-icon input {
    padding-left: 42px;
}

/* Filter bar */
.filter-bar {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    flex: 1;
    min-width: 100px;
}

.filter-card .card-body {
    padding: 14px;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    user-select: none;
}

.checkbox-item:has(input:checked) {
    background: rgba(59,130,246,0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-item small {
    color: var(--text-lighter);
    font-weight: 400;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(59,130,246,0.1);
    color: var(--primary);
}

.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-blue { background: rgba(59,130,246,0.1); color: var(--primary); }

.badge-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

/* ============================================
   TAB BAR
   ============================================ */
.tab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tab-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.tab.active .tab-badge {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   ACTIVITY LIST
   ============================================ */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:active {
    background: var(--bg);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(59,130,246,0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

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

.activity-info strong {
    display: block;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-detail {
    font-size: 12px;
    color: var(--text-light);
}

.activity-date {
    font-size: 11px;
    color: var(--text-lighter);
    white-space: nowrap;
}

.activity-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.action-btns {
    display: flex;
    gap: 4px;
}

/* ============================================
   WORK HOURS
   ============================================ */
.scroll-wrapper {
    position: relative;
}

.work-hours-list {
    max-height: 400px;
    overflow-y: auto;
}

.scroll-indicator {
    position: sticky;
    bottom: 0;
    text-align: center;
    padding: 10px;
    background: linear-gradient(to bottom, transparent, var(--bg-card) 50%);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    animation: bounceArrow 1.5s ease-in-out infinite;
}

.scroll-indicator i {
    margin-right: 4px;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.work-hour-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.work-hour-item:last-child {
    border-bottom: none;
}

.work-hour-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
}

.work-hour-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.work-hour-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.work-hour-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.work-hour-info strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.work-hour-info small {
    font-size: 12px;
    color: var(--text-light);
}

.work-hour-input {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
    padding-left: 30px;
}

.work-hour-input .form-control {
    padding: 10px 12px;
    font-size: 14px;
}

.btn-save-hours {
    margin-top: 16px;
    font-size: 16px;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

/* Selected employee highlight */
.work-hour-item.emp-selected {
    background: rgba(59,130,246,0.06);
    border-left: 3px solid var(--primary);
}

.work-hour-item.emp-selected .work-hour-avatar {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34,197,94,0.35);
}

.work-hour-item.emp-selected strong {
    color: var(--primary);
}

/* Radio buttons styled as chips */
.checkbox-item:has(input[type="radio"]:checked) {
    background: rgba(59,130,246,0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.checkbox-item input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.sector-select-wrapper {
    margin-top: 8px;
}

.sector-select-wrapper label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table tbody tr:active {
    background: var(--bg);
}

.total-row {
    background: rgba(59,130,246,0.05) !important;
    border-top: 2px solid var(--primary) !important;
}

.total-row td {
    font-weight: 700;
    color: var(--primary);
}

.subtotal-row {
    background: #f1f5f9 !important;
    font-weight: 600;
}

.subtotal-row td {
    border-top: 1px solid #cbd5e1;
    color: #334155;
}

.sector-header-row {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
}

.sector-header-row td {
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 12px;
    letter-spacing: 0.3px;
}

.sector-header-row td i {
    margin-right: 6px;
    opacity: 0.8;
}

/* Date Mode Toggle */
.date-mode-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.date-mode-btn {
    flex: 1;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.date-mode-btn.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.date-mode-btn:not(.active):active {
    background: var(--border-light);
}

/* Grid Report (Calendar-style) */
.grid-report-section {
    margin-bottom: 20px;
}

.grid-report-header {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    font-weight: 700;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.grid-report-header i {
    margin-right: 6px;
    opacity: 0.8;
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #334155;
    font-size: 12px;
}

.grid-table th {
    background: #0f172a;
    color: #fff;
    padding: 6px 3px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid #475569;
}

.grid-table td {
    padding: 6px 3px;
    text-align: center;
    border: 2px solid #94a3b8;
    font-size: 12px;
}

.grid-table .col-nr {
    width: 32px;
    color: var(--text-muted);
    font-size: 11px;
}

.grid-table .col-name {
    text-align: left;
    padding: 6px 10px;
    white-space: nowrap;
    font-weight: 500;
    min-width: 120px;
    background: #fff;
}

.grid-table thead .col-name {
    background: #0f172a;
}

.grid-table .col-day {
    min-width: 28px;
    font-size: 11px;
}

.grid-table .col-day.has-hours {
    background: #e2e8f0;
    font-weight: 600;
    color: #111827;
}

.grid-table .col-tot {
    background: #f1f5f9;
    font-weight: 700;
    min-width: 40px;
    color: var(--primary);
}

.grid-table .col-pay {
    background: #fef9c3;
    font-weight: 700;
    min-width: 70px;
    color: #92400e;
    font-size: 11px;
    white-space: nowrap;
}

.grid-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.grid-table tbody tr:nth-child(even) .col-name {
    background: #f8fafc;
}

.grid-table .total-row td {
    background: rgba(59,130,246,0.08);
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--primary);
}

.grid-table .total-row .col-name {
    background: rgba(59,130,246,0.08);
}

.grid-grand-total {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    border-radius: var(--radius);
    text-align: right;
    font-size: 15px;
}

/* ============================================
   AUDIT LOGS
   ============================================ */
.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.audit-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.audit-green { background: var(--success-bg); color: var(--success); }
.audit-red { background: var(--danger-bg); color: var(--danger); }
.audit-blue { background: rgba(59,130,246,0.1); color: var(--primary); }
.audit-orange { background: var(--warning-bg); color: var(--warning); }
.audit-gray { background: var(--bg); color: var(--text-light); }

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

.audit-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.audit-detail {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    word-break: break-word;
}

.audit-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-lighter);
}

.audit-meta i {
    margin-right: 4px;
}

.audit-time {
    font-size: 11px;
    color: var(--text-lighter);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 16px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
}

.modal-body {
    padding: 4px 20px 30px;
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.35s ease, toastOut 0.35s ease 2.5s forwards;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

.toast-info {
    background: var(--primary);
    color: #fff;
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.quick-action-btn:active {
    transform: scale(0.95);
    background: var(--bg);
}

.quick-action-btn i {
    font-size: 22px;
    color: var(--primary);
}

/* ============================================
   TODAY STAT
   ============================================ */
.today-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.today-label {
    font-size: 14px;
    color: var(--text-light);
}

.today-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-lighter);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

.empty-state.small {
    padding: 24px 16px;
}

.empty-state.small i {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state.small p {
    font-size: 13px;
}

/* ============================================
   LOADING
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--primary);
    font-size: 24px;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted { color: var(--text-lighter); font-size: 12px; }
.header-actions { display: flex; gap: 8px; }

/* ============================================
   PRINT STYLES
   ============================================ */
.print-only {
    display: none;
}

@media print {
    .app-header, .bottom-nav, .sidebar, .sidebar-overlay,
    .filter-card, .page-header .btn, #toast-container,
    .modal-overlay, .quick-actions, .btn-save-hours { display: none !important; }

    .app-main { padding: 0 !important; }
    .page-container { max-width: 100%; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .print-only { display: block; }

    body { background: #fff; }
}

/* ============================================
   RESPONSIVE - Tablet & Desktop
   ============================================ */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }

    .app-main {
        padding-bottom: 32px;
    }

    .page-container {
        max-width: 700px;
    }

    .user-name {
        display: inline;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-content {
        border-radius: 20px;
        margin-bottom: 0;
    }

    .modal-overlay {
        align-items: center;
    }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .work-hour-input {
        grid-template-columns: 120px 1fr;
    }
}

@media (min-width: 1024px) {
    .page-container {
        max-width: 800px;
    }
}

/* --- Offline Banner --- */
.offline-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--danger);
    color: #fff;
    padding: 10px 16px;
    justify-content: center;
    align-items: center;
    animation: slideDown 0.3s ease;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.offline-banner-content i {
    font-size: 16px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
