/* ============================================
   Dotlancing Projects - Main Stylesheet
   Premium Agency UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* Dark Theme (default) */
    --bg-base:       #0a0c10;
    --bg-surface:    #111318;
    --bg-card:       #161b24;
    --bg-input:      #1c2230;
    --bg-hover:      #1e2536;
    --border:        rgba(255,255,255,0.07);
    --border-active: rgba(99,179,237,0.4);

    --text-primary:  #e8edf5;
    --text-secondary:#8a95a8;
    --text-muted:    #4a5568;
    --text-inverse:  #0a0c10;

    --accent:        #63b3ed;
    --accent-dark:   #2b6cb0;
    --accent-glow:   rgba(99,179,237,0.2);

    --green:         #48bb78;
    --green-bg:      rgba(72,187,120,0.12);
    --orange:        #ed8936;
    --orange-bg:     rgba(237,137,54,0.12);
    --red:           #fc8181;
    --red-bg:        rgba(252,129,129,0.12);
    --purple:        #b794f4;
    --purple-bg:     rgba(183,148,244,0.12);
    --yellow:        #f6e05e;
    --yellow-bg:     rgba(246,224,94,0.12);

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg:     0 12px 40px rgba(0,0,0,0.6);
    --shadow-glow:   0 0 30px rgba(99,179,237,0.15);

    --sidebar-w:     260px;
    --topnav-h:      64px;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;

    --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display:  'Syne', sans-serif;
    --font-body:     'DM Sans', sans-serif;
}

[data-theme="light"] {
    --bg-base:       #f0f2f7;
    --bg-surface:    #fafbfd;
    --bg-card:       #ffffff;
    --bg-input:      #f0f4f8;
    --bg-hover:      #edf2f7;
    --border:        rgba(0,0,0,0.08);
    --border-active: rgba(49,130,206,0.4);

    --text-primary:  #1a202c;
    --text-secondary:#4a5568;
    --text-muted:    #a0aec0;
    --text-inverse:  #ffffff;

    --accent:        #3182ce;
    --accent-dark:   #2c5282;
    --accent-glow:   rgba(49,130,206,0.15);

    --green:         #276749;
    --green-bg:      rgba(39,103,73,0.1);
    --orange:        #c05621;
    --orange-bg:     rgba(192,86,33,0.1);
    --red:           #c53030;
    --red-bg:        rgba(197,48,48,0.1);
    --purple:        #6b46c1;
    --purple-bg:     rgba(107,70,193,0.1);
    --yellow:        #b7791f;
    --yellow-bg:     rgba(183,121,31,0.1);

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.1);
    --shadow-md:     0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:     0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow:   0 0 30px rgba(49,130,206,0.1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

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

input, textarea, select {
    font-family: var(--font-body);
    font-size: 14px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   LAYOUT
   ============================================ */

.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    flex: 1;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 8px 0;
}

.nav-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 20px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    border-radius: 0;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-mini { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.user-avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 1.5px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--accent);
    overflow: hidden; flex-shrink: 0;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.user-name-sm { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-sm { display: block; font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.btn-logout {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--red-bg);
    color: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-logout:hover { background: var(--red); color: #fff; }

/* Top Navbar */
.topnav {
    position: sticky;
    top: 0;
    height: var(--topnav-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
    backdrop-filter: blur(12px);
}

.topnav-left { display: flex; align-items: center; gap: 16px; }
.topnav-right { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    width: 36px; height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}
.menu-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topnav-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}
.theme-toggle:hover { background: var(--accent-glow); color: var(--accent); }

/* Notification */
.notif-wrapper { position: relative; }
.notif-btn {
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    position: relative;
    transition: var(--transition);
}
.notif-btn:hover { background: var(--accent-glow); color: var(--accent); }
.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
    animation: dropIn 0.15s ease;
}
.notif-dropdown.open { display: flex; }

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.mark-all-read {
    background: none; border: none;
    color: var(--accent); cursor: pointer;
    font-size: 12px; font-family: var(--font-body);
}

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-glow); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}

.notif-icon.info { background: var(--accent-glow); color: var(--accent); }
.notif-icon.success { background: var(--green-bg); color: var(--green); }
.notif-icon.warning { background: var(--orange-bg); color: var(--orange); }
.notif-icon.danger { background: var(--red-bg); color: var(--red); }

.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.notif-msg { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }

/* User Menu */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-avatar-top {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 13px; font-weight: 700; color: var(--accent);
    overflow: hidden; cursor: pointer;
}
.user-avatar-top img { width: 100%; height: 100%; object-fit: cover; }
.user-greeting { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Page Content */
.page-content { flex: 1; padding: 24px; }

/* ============================================
   CARDS & COMPONENTS
   ============================================ */

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    margin-bottom: 14px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-change {
    font-size: 11px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card.blue .stat-icon { background: var(--accent-glow); color: var(--accent); }
.stat-card.blue::before { background: var(--accent); }
.stat-card.green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card.green::before { background: var(--green); }
.stat-card.orange .stat-icon { background: var(--orange-bg); color: var(--orange); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-card.red::before { background: var(--red); }
.stat-card.purple .stat-icon { background: var(--purple-bg); color: var(--purple); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.yellow .stat-icon { background: var(--yellow-bg); color: var(--yellow); }
.stat-card.yellow::before { background: var(--yellow); }

/* Chart Cards */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.chart-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-subtitle { font-size: 12px; color: var(--text-muted); }

.chart-wrap { position: relative; height: 220px; }

/* ============================================
   TABLE
   ============================================ */

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

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

.table-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.table-responsive { overflow-x: auto; }

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

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-hover); }

/* ============================================
   BADGES / STATUS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-pending      { background: var(--yellow-bg); color: var(--yellow); }
.badge-in_progress  { background: var(--accent-glow); color: var(--accent); }
.badge-pending_review { background: var(--purple-bg); color: var(--purple); }
.badge-completed    { background: var(--green-bg); color: var(--green); }
.badge-delayed      { background: var(--red-bg); color: var(--red); }

.badge-low      { background: var(--green-bg); color: var(--green); }
.badge-medium   { background: var(--yellow-bg); color: var(--yellow); }
.badge-high     { background: var(--orange-bg); color: var(--orange); }
.badge-critical { background: var(--red-bg); color: var(--red); }

.badge-admin    { background: var(--purple-bg); color: var(--purple); }
.badge-employee { background: var(--accent-glow); color: var(--accent); }
.badge-active   { background: var(--green-bg); color: var(--green); }
.badge-blocked  { background: var(--red-bg); color: var(--red); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px var(--accent-glow); }

.btn-success {
    background: var(--green);
    color: #fff;
}
.btn-success:hover { opacity: 0.85; color: #fff; }

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(252,129,129,0.2);
}
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-warning {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: rgba(237,137,54,0.2);
}
.btn-warning:hover { background: var(--orange); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-active); }

.btn-sm { padding: 6px 12px; font-size: 12px; gap: 5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ============================================
   FORMS
   ============================================ */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-label span { color: var(--red); }

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
}
.form-control:focus { border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }

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

.form-error { font-size: 11.5px; color: var(--red); margin-top: 5px; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* Search */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-wrap .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}
.search-wrap .form-control { padding-left: 36px; }

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.2s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.modal-box.sm { max-width: 420px; }
.modal-box.lg { max-width: 800px; }
.modal-box.xl { max-width: 1000px; }

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

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px; height: 30px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: transparent; }

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

/* ============================================
   TIME TRACKER
   ============================================ */

.time-tracker {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tracker-display {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    min-width: 90px;
}

.tracker-btns { display: flex; gap: 8px; }

/* ============================================
   EDIT LOG ICON
   ============================================ */

.edit-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    background: var(--orange-bg);
    color: var(--orange);
    border-radius: 50%;
    font-size: 9px;
    cursor: pointer;
    transition: var(--transition);
    vertical-align: middle;
    margin-left: 4px;
}
.edit-indicator:hover { background: var(--orange); color: #fff; }

/* Log Timeline */
.log-timeline { display: flex; flex-direction: column; gap: 0; }
.log-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.log-item:last-child { border-bottom: none; }
.log-field { font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.log-old { color: var(--red); }
.log-new { color: var(--green); }
.log-arrow { color: var(--text-muted); }
.log-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.file-drop-zone:hover, .file-drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.file-drop-icon { font-size: 28px; color: var(--text-muted); margin-bottom: 8px; }
.file-drop-text { font-size: 13px; color: var(--text-secondary); }
.file-drop-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}
.file-item-icon { color: var(--accent); font-size: 16px; }
.file-item-name { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-muted); font-size: 11px; }
.file-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; transition: var(--transition); }
.file-item-remove:hover { color: var(--red); }

/* ============================================
   DATE/TIME WIDGET
   ============================================ */

.datetime-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.greeting-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.greeting-text span { color: var(--accent); }

.datetime-info { text-align: right; }
.live-time { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text-primary); }
.live-date { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 99px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent);
    transition: width 0.5s ease;
}

/* ============================================
   FILTERS
   ============================================ */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-bar .form-control { width: auto; min-width: 140px; }

/* ============================================
   TOAST
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.25s ease;
    transition: var(--transition);
}
.toast.exit { animation: slideOut 0.25s ease forwards; }

.toast-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 0; line-height: 1; }

.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--orange); }
.toast.info .toast-icon { color: var(--accent); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--orange); }
.toast.info { border-left: 3px solid var(--accent); }

/* ============================================
   AVATAR
   ============================================ */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.fa-spin { animation: spin 1s linear infinite; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(99,179,237,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 80% 70%, rgba(183,148,244,0.06) 0%, transparent 60%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-logo-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
}

.login-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    padding: 60px 20px;
    text-align: center;
}
.empty-icon { font-size: 40px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-text { font-size: 13px; color: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-close { display: flex; }
    .main-wrapper { margin-left: 0; }
    .menu-toggle { display: flex; }

    .form-row { grid-template-columns: 1fr; }
    .form-row.col-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .table-actions { width: 100%; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100%; }
    .datetime-widget { flex-direction: column; text-align: center; }
    .datetime-info { text-align: center; }
    .modal-box { border-radius: var(--radius-lg); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 28px 20px; }
    .topnav { padding: 0 16px; }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* Misc utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.font-display { font-family: var(--font-display); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
