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

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0A0A0A;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #fff;
  }

  /* ---- TOP NAV ---- */
  .topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    height: 60px;
    background: #000;
    border-bottom: 3px solid #CC1F1F;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .topnav-left {
    display: flex;
    align-items: center;
    gap: 2.5rem;
  }
  .logo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    text-decoration: none;
  }
  .logo span { color: #CC1F1F; }

  .nav-links {
    display: flex;
    gap: 6px;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
  }
  .nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
  .nav-link.active { color: #fff; background: rgba(204,31,31,0.15); }
  .nav-link i { font-size: 17px; }

  .topnav-right {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .nav-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    border: none;
    background: none;
  }
  .nav-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
  .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #CC1F1F;
    border-radius: 50%;
    border: 2px solid #000;
  }
  .user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    color: #fff;
  }
  .user-pill:hover { background: rgba(255,255,255,0.1); }
  .user-avatar {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #CC1F1F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
  }
  .user-name {
    font-size: 13px;
    font-weight: 600;
  }
  .user-pill i { font-size: 14px; color: rgba(255,255,255,0.65); }

  /* ---- MAIN ---- */
  .main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 2.5rem 3rem;
  }

  /* ---- WELCOME BAR ---- */
  .welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
  }
  .welcome-text h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
  }
  .welcome-text h1 em {
    color: #CC1F1F;
    font-style: normal;
  }
  .welcome-text p {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
  }
  .welcome-actions {
    display: flex;
    gap: 10px;
  }
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
  }
  .btn i { font-size: 16px; }
  .btn-primary { background: #CC1F1F; color: #fff; }
  .btn-primary:hover { background: #A81818; }
  .btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1.5px solid rgba(255,255,255,0.15);
  }
  .btn-outline:hover { color: #fff; border-color: rgba(255,255,255,0.6); }

  /* ---- STAT CARDS ---- */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 2rem;
  }
  .stat-card {
    background: #111;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.15s;
  }
  .stat-card:hover { border-color: rgba(204,31,31,0.3); }
  .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }
  .stat-icon.red { background: rgba(204,31,31,0.15); color: #CC1F1F; }
  .stat-icon.green { background: rgba(34,197,94,0.12); color: #22C55E; }
  .stat-icon.blue { background: rgba(59,130,246,0.12); color: #3B82F6; }
  .stat-icon.amber { background: rgba(245,158,11,0.12); color: #F59E0B; }
  .stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
  }
  .stat-change.up { color: #22C55E; }
  .stat-change.down { color: #EF4444; }
  .stat-change i { font-size: 14px; }
  .stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 2px;
  }
  .stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
  }

  /* ---- CONTENT GRID ---- */
  .content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
  }

  /* ---- PANEL ---- */
  .panel {
    background: #111;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
  }
  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .panel-title {
    font-size: 15px;
    font-weight: 700;
  }
  .panel-action {
    font-size: 12px;
    font-weight: 600;
    color: #CC1F1F;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
  }
  .panel-action:hover { text-decoration: underline; }

  /* Tier Cards */
  .tier-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px; }
  .tier-card { border-radius: 10px; border: 1.5px solid; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
  .tier-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.35); }
  .tier-card-header { padding: 14px 14px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 1px solid; }
  .tier-card-name-wrap { flex: 1; min-width: 0; }
  .tier-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; opacity: 0.6; }
  .tier-name-input { width: 100%; padding: 4px 0; font-size: 15px; font-weight: 800; font-family: inherit; background: transparent; border: none; border-bottom: 1.5px solid transparent; outline: none; letter-spacing: 0.02em; transition: border-color 0.15s; }
  .tier-name-input:not([readonly]):focus { border-bottom-color: currentColor; }
  .tier-name-input[readonly] { cursor: default; }
  .tier-remove { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: rgba(239,68,68,0.08); color: rgba(239,68,68,0.5); font-size: 14px; cursor: pointer; border-radius: 5px; transition: color 0.15s, background 0.15s; flex-shrink: 0; }
  .tier-remove:hover { color: #EF4444; background: rgba(239,68,68,0.18); }
  .tier-card-body { padding: 14px; }
  .tier-card-body-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; opacity: 0.5; }
  .tier-input-wrap { display: flex; align-items: center; gap: 5px; }
  .tier-prefix { font-size: 15px; font-weight: 700; opacity: 0.5; }
  .tier-input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 20px; font-weight: 800; font-family: inherit; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 6px; outline: none; text-align: right; transition: border-color 0.15s, background 0.15s; }
  .tier-input:focus { background: rgba(255,255,255,0.1); }
  .tier-input[readonly] { cursor: default; opacity: 0.6; }
  .tier-suffix { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.4; white-space: nowrap; }
  .tier-source-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .tier-source-select { flex: 1; padding: 5px 8px; font-size: 12px; font-weight: 600; font-family: inherit; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 5px; outline: none; color: inherit; cursor: pointer; }
  .tier-source-select:focus { border-color: rgba(255,255,255,0.2); }
  .tier-enabled-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; opacity: 0.5; cursor: pointer; }
  .tier-enabled-toggle input { cursor: pointer; }
  body.light .tier-source-select { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
  .tier-actions { padding: 12px 1.5rem; border-top: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: space-between; align-items: center; }
  .tier-add-btn { display: flex; align-items: center; gap: 4px; border: none; background: none; color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; padding: 4px 0; }
  .tier-add-btn:hover { color: #CC1F1F; }
  .tier-add-btn i { font-size: 15px; }
  body.light .tier-card { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
  body.light .tier-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); }
  body.light .tier-input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
  body.light .tier-input:focus { background: rgba(0,0,0,0.07); }
  body.light .tier-actions { border-top-color: #EEE; }
  body.light .tier-add-btn { color: rgba(0,0,0,0.4); }
  body.light .tier-add-btn:hover { color: #CC1F1F; }
  @media (max-width: 768px) { .tier-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; } }
  @media (max-width: 400px) { .tier-cards-grid { grid-template-columns: 1fr; } }

  /* Sales Log */
  .sales-summary { display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .sales-summary-item { flex: 1; padding: 14px 1.5rem; text-align: center; border-right: 1px solid rgba(255,255,255,0.06); }
  .sales-summary-item:last-child { border-right: none; }
  .sales-summary-val { font-size: 20px; font-weight: 700; color: #22C55E; }
  .sales-summary-label { font-size: 11px; color: rgba(255,255,255,0.62); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
  .sales-list { max-height: 400px; overflow-y: auto; }
  .sale-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.1s; }
  .sale-item:last-child { border-bottom: none; }
  .sale-item:hover { background: rgba(255,255,255,0.02); }
  .sale-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(34,197,94,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #22C55E; font-size: 18px; margin-top: 2px; }
  .sale-body { flex: 1; min-width: 0; }
  .sale-title { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sale-meta { font-size: 12px; color: rgba(255,255,255,0.62); margin-top: 2px; }
  .sale-meta span { margin-right: 10px; }
  .sale-price { font-size: 15px; font-weight: 700; color: #22C55E; white-space: nowrap; flex-shrink: 0; }
  .sale-delete { background: none; border: none; color: rgba(255,255,255,0.15); cursor: pointer; font-size: 14px; padding: 4px; border-radius: 4px; flex-shrink: 0; }
  .sale-delete:hover { color: #EF4444; background: rgba(239,68,68,0.1); }
  .sale-empty { padding: 2.5rem 1.5rem; text-align: center; color: rgba(255,255,255,0.25); font-size: 13px; }
  .sale-empty i { font-size: 36px; display: block; margin-bottom: 10px; color: rgba(255,255,255,0.1); }
  /* Record sale form */
  .sale-form { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06); display: none; }
  .sale-form.open { display: block; }
  .sale-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sale-form-full { grid-column: 1 / -1; }
  .sale-form label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.65); margin-bottom: 4px; }
  .sale-form input, .sale-form select, .sale-form textarea { width: 100%; padding: 8px 10px; font-size: 13px; font-family: inherit; color: #fff; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 5px; outline: none; }
  .sale-form input:focus, .sale-form select:focus, .sale-form textarea:focus { border-color: #CC1F1F; }
  .sale-form textarea { resize: vertical; min-height: 50px; }
  .sale-form select option { background: #1A1A1A; color: #fff; }
  .sale-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
  body.light .sales-summary { border-bottom-color: #EEE; }
  body.light .sales-summary-item { border-right-color: #EEE; }
  body.light .sales-summary-label { color: rgba(0,0,0,0.4); }
  body.light .sale-item { border-bottom-color: #F0F0F0; }
  body.light .sale-item:hover { background: #FAFAFA; }
  body.light .sale-title { color: #111; }
  body.light .sale-meta { color: rgba(0,0,0,0.4); }
  body.light .sale-delete { color: rgba(0,0,0,0.15); }
  body.light .sale-empty { color: rgba(0,0,0,0.3); }
  body.light .sale-empty i { color: rgba(0,0,0,0.1); }
  body.light .sale-form { border-top-color: #EEE; }
  body.light .sale-form label { color: rgba(0,0,0,0.45); }
  body.light .sale-form input, body.light .sale-form select, body.light .sale-form textarea { background: #fff; border-color: #DDD; color: #111; }
  body.light .sale-form select option { background: #fff; color: #111; }
  .panel-action i { font-size: 14px; }

  /* ---- LISTINGS TABLE ---- */
  /* State tabs */
  .state-tabs {
    display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 8px; overflow-x: auto;
  }
  .state-tab {
    padding: 10px 18px; font-size: 13px; font-weight: 600;
    color: rgba(255,255,255,0.65); cursor: pointer; border: none; background: none;
    border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
  }
  .state-tab:hover { color: rgba(255,255,255,0.7); }
  .state-tab.active { color: #CC1F1F; border-bottom-color: #CC1F1F; }
  .state-tab .tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; font-weight: 700;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.65);
    border-radius: 9px; margin-left: 6px;
  }
  .state-tab.active .tab-count { background: rgba(204,31,31,0.15); color: #CC1F1F; }

  .listings-table {
    width: 100%;
    border-collapse: collapse;
  }
  .listings-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.62);
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .listings-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
  }
  .listings-table tr:last-child td { border-bottom: none; }
  .listings-table tbody tr { cursor: pointer; }
  .listings-table tbody tr:hover td { background: rgba(255,255,255,0.04); }

  .unit-cell {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .unit-thumb {
    width: 80px;
    height: 52px;
    background: #1A1A1A;
    border-radius: 5px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.15);
    font-size: 18px;
  }
  .unit-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .unit-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1px;
  }
  .unit-info span {
    font-size: 12px;
    color: rgba(255,255,255,0.62);
  }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .badge-available { background: rgba(34,197,94,0.12); color: #22C55E; }
  .badge-contract { background: rgba(245,158,11,0.12); color: #F59E0B; }
  .badge-sold { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.62); }
  .badge-type1 { background: rgba(59,130,246,0.3); color: #fff; }
  .badge-type2 { background: rgba(168,85,247,0.3); color: #fff; }
  .badge-type3 { background: rgba(236,72,153,0.3); color: #fff; }

  .price { font-weight: 700; color: #fff; }
  .price-input {
    width: 110px;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
  }
  .price-input:focus {
    border-color: #CC1F1F;
    background: rgba(255,255,255,0.08);
  }
  .price-input::placeholder { color: rgba(255,255,255,0.2); font-weight: 400; }

  /* ---- ACTIVITY FEED ---- */
  .activity-list { padding: 4px 0; }
  .activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 1.5rem;
    transition: background 0.1s;
  }
  .activity-item:hover { background: rgba(255,255,255,0.02); }
  .activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
  }
  .activity-dot.red { background: #CC1F1F; }
  .activity-dot.green { background: #22C55E; }
  .activity-dot.blue { background: #3B82F6; }
  .activity-dot.amber { background: #F59E0B; }
  .activity-content {
    flex: 1;
    min-width: 0;
  }
  .activity-content p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    margin-bottom: 2px;
  }
  .activity-content p strong { color: #fff; }
  .activity-content time {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
  }

  /* ---- QUICK ACTIONS ---- */
  .quick-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
  }
  .quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    cursor: pointer;
  }
  .quick-action:hover { background: rgba(255,255,255,0.05); color: #fff; }
  .quick-action i {
    font-size: 18px;
    color: #CC1F1F;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(204,31,31,0.1);
    border-radius: 6px;
    flex-shrink: 0;
  }

  /* ---- LIGHT MODE ---- */
  body.light { background: #F5F5F5; color: #111; }
  body.light .topnav { background: #fff; border-bottom-color: #CC1F1F; }
  body.light .logo { color: #111; }
  body.light .nav-link { color: rgba(0,0,0,0.5); }
  body.light .nav-link:hover { color: #111; background: rgba(0,0,0,0.04); }
  body.light .nav-link.active { color: #CC1F1F; background: rgba(204,31,31,0.08); }
  body.light .nav-icon-btn { color: rgba(0,0,0,0.4); }
  body.light .nav-icon-btn:hover { color: #111; background: rgba(0,0,0,0.04); }
  body.light .user-pill { background: rgba(0,0,0,0.05); color: #111; }
  body.light .user-pill:hover { background: rgba(0,0,0,0.08); }
  body.light .user-pill .ti-chevron-down { color: rgba(0,0,0,0.3); }
  body.light .dropdown { background: #fff; border-color: #E0E0E0; box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
  body.light .dropdown-header { color: #999; border-bottom-color: #EEE; }
  body.light .dropdown-item { color: #444; }
  body.light .dropdown-item:hover { background: #F5F5F5; color: #111; }
  body.light .dropdown-item i { color: #999; }
  body.light .dropdown-divider { background: #EEE; }
  body.light .notif-body p { color: #444; }
  body.light .notif-body p strong { color: #111; }
  body.light .notif-body time { color: #999; }
  body.light .notif-item { border-bottom-color: #EEE; }
  body.light .notif-item:hover { background: #F9F9F9; }
  body.light .notif-footer { border-top-color: #EEE; }
  body.light .welcome-text h1 { color: #111; }
  body.light .welcome-text p { color: #777; }
  body.light .stat-card { background: #fff; border-color: #E8E8E8; }
  body.light .stat-card:hover { border-color: rgba(204,31,31,0.3); }
  body.light .stat-value { color: #111; }
  body.light .stat-label { color: #888; }
  body.light .panel { background: #fff; border-color: #E8E8E8; }
  body.light .panel-header { border-bottom-color: #EEE; }
  body.light .panel-title { color: #111; }
  body.light .listings-table th { color: rgba(0,0,0,0.45); border-bottom-color: #EEE; }
  body.light .listings-table td { color: rgba(0,0,0,0.8); border-bottom-color: #F0F0F0; }
  body.light .unit-thumb { background: #F5F5F5; color: rgba(0,0,0,0.2); }
  body.light .unit-info strong { color: #111; }
  body.light .unit-info span { color: rgba(0,0,0,0.45); }
  body.light .badge-sold { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.45); }
  body.light .price-input { background: #fff; border-color: #DDD; color: #111; }
  body.light .price-input:focus { border-color: #CC1F1F; background: #fff; }
  body.light .activity-item:hover { background: #F5F5F5; }
  body.light .activity-content p { color: rgba(0,0,0,0.65); }
  body.light .activity-content p strong { color: #111; }
  body.light .activity-content time { color: #777; }
  body.light .quick-action { color: #555; }
  body.light .quick-action:hover { background: #F5F5F5; color: #111; }
  body.light .bottombar { background: #fff; border-top-color: #E8E8E8; }
  body.light .bottombar-left { color: #999; }
  body.light .bottombar-right a { color: #999; }
  body.light .bottombar-right a:hover { color: #555; }
  body.light .save-toast { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
  body.light .modal { background: #fff; border-color: #E0E0E0; box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
  body.light .modal-header { border-bottom-color: #EEE; }
  body.light .modal-title { color: #111; }
  body.light .modal-close { color: rgba(0,0,0,0.4); }
  body.light .modal-close:hover { background: rgba(0,0,0,0.05); color: #111; }
  body.light .modal-footer { border-top-color: #EEE; }
  body.light .modal .form-label { color: rgba(0,0,0,0.45); }
  body.light .modal .form-input { background: #fff; border-color: #DDD; color: #111; }
  body.light .modal .form-input::placeholder { color: rgba(0,0,0,0.3); }
  body.light .modal .form-select { background-color: #fff; border-color: #DDD; color: #111; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
  body.light .modal .form-select option { background: #fff; color: #111; }
  body.light .modal .form-textarea { background: #fff; border-color: #DDD; color: #111; }
  body.light .modal .form-textarea::placeholder { color: rgba(0,0,0,0.3); }
  body.light .modal-btn-ghost { color: rgba(0,0,0,0.5); }
  body.light .modal-btn-ghost:hover { background: rgba(0,0,0,0.05); color: #111; }
  body.light .export-opt { color: #444; }
  body.light .format-btn { background: rgba(0,0,0,0.05); color: #444; }
  body.light .format-btn.active { background: #CC1F1F; color: #fff; }
  body.light .status-select { background: #fff; border-color: #DDD; color: #111; }
  body.light .status-select option { background: #fff; color: #111; }
  body.light .state-tabs { border-bottom-color: #EEE; }
  body.light .state-tab { color: rgba(0,0,0,0.45); }
  body.light .state-tab:hover { color: rgba(0,0,0,0.7); }
  body.light .state-tab.active { color: #CC1F1F; border-bottom-color: #CC1F1F; }
  body.light .state-tab .tab-count { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.45); }
  body.light .price { color: #111; }
  body.light .price-input::placeholder { color: rgba(0,0,0,0.3); }
  body.light .btn-outline { color: rgba(0,0,0,0.6); border-color: rgba(0,0,0,0.15); }
  body.light .btn-outline:hover { color: #111; border-color: rgba(0,0,0,0.3); background: rgba(0,0,0,0.03); }
  body.light .listings-table tbody tr:hover td { background: #F9F9F9; }
  body.light .approval-thumb { background: #F5F5F5; }
  body.light .audit-body strong { color: #111; }
  body.light .notif-empty { color: rgba(0,0,0,0.35); }
  body.light .notif-empty i { color: rgba(0,0,0,0.15); }
  body.light .notif-read-btn { color: rgba(0,0,0,0.3); }
  body.light .user-pill .ti-chevron-down { color: rgba(0,0,0,0.3); }
  body.light .badge-type1 { color: #1D4ED8; }
  body.light .badge-type2 { color: #7C3AED; }
  body.light .badge-type3 { color: #DB2777; }
  body.light .audit-entry { border-bottom-color: #EEE; }
  .audit-filter-select { background: #1a1a1a; color: #fff; border: 1px solid #333; }
  body.light .audit-filter-select { background: #fff; color: #111; border-color: #DDD; }

  /* ---- DROPDOWNS & PANELS ---- */
  .dropdown-wrap { position: relative; }
  .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #1A1A1A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
  }
  .dropdown.open { display: block; }
  .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.62);
  }
  .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }
  .dropdown-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
  .dropdown-item i { font-size: 17px; color: rgba(255,255,255,0.62); width: 20px; text-align: center; }
  .dropdown-item.danger { color: #EF4444; }
  .dropdown-item.danger i { color: #EF4444; }
  .dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }

  /* Notification Panel */
  .notif-panel { min-width: 340px; right: 0; }
  .notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.1s;
    cursor: pointer;
  }
  .notif-item:hover { background: rgba(255,255,255,0.03); }
  .notif-item:last-child { border-bottom: none; }
  .notif-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
  }
  .notif-dot.red { background: #CC1F1F; }
  .notif-dot.green { background: #22C55E; }
  .notif-dot.blue { background: #3B82F6; }
  .notif-body { flex: 1; }
  .notif-body p { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.4; margin-bottom: 2px; }
  .notif-body p strong { color: #fff; }
  .notif-body time { font-size: 11px; color: rgba(255,255,255,0.25); }
  .notif-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: rgba(255,255,255,0.6); }
  .notif-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
  }
  .notif-footer a {
    font-size: 12px; font-weight: 600; color: #CC1F1F;
    text-decoration: none; cursor: pointer;
  }
  .notif-footer a:hover { text-decoration: underline; }

  /* ---- MODAL ---- */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    align-items: center;
    justify-content: center;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: #1A1A1A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  }
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .modal-title { font-size: 18px; font-weight: 700; }
  .modal-close {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: rgba(255,255,255,0.65);
    font-size: 20px; cursor: pointer; transition: background 0.15s, color 0.15s;
  }
  .modal-close:hover { background: rgba(255,255,255,0.05); color: #fff; }
  .modal-body { padding: 1.25rem 1.5rem; }
  .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
  .modal .form-group { margin-bottom: 16px; }
  .modal .form-label {
    display: block; font-size: 11px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: rgba(255,255,255,0.65); margin-bottom: 6px;
  }
  .modal .form-input {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1.5px solid rgba(255,255,255,0.1); border-radius: 6px;
    background: rgba(255,255,255,0.05); color: #fff;
    outline: none; transition: border-color 0.15s;
    font-family: inherit;
  }
  .modal .form-input:focus { border-color: #CC1F1F; }
  .modal .form-input::placeholder { color: rgba(255,255,255,0.2); }
  .modal .form-select {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1.5px solid rgba(255,255,255,0.1); border-radius: 6px;
    background: rgba(255,255,255,0.05); color: #fff;
    outline: none; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
  }
  .modal .form-select option { background: #1A1A1A; color: #fff; }
  .modal .form-select:focus { border-color: #CC1F1F; }
  .modal .form-textarea {
    width: 100%; padding: 10px 12px; font-size: 14px;
    border: 1.5px solid rgba(255,255,255,0.1); border-radius: 6px;
    background: rgba(255,255,255,0.05); color: #fff;
    outline: none; resize: vertical; min-height: 80px;
    font-family: inherit;
  }
  .modal .form-textarea:focus { border-color: #CC1F1F; }
  .modal .form-textarea::placeholder { color: rgba(255,255,255,0.2); }
  .modal-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; font-size: 13px; font-weight: 700;
    letter-spacing: 0.03em; text-transform: uppercase;
    border-radius: 6px; border: none; cursor: pointer;
  }
  .modal-btn i { font-size: 16px; }
  .modal-btn-primary { background: #CC1F1F; color: #fff; }
  .modal-btn-primary:hover { background: #A81818; }
  .modal-btn-ghost {
    background: transparent; color: rgba(255,255,255,0.5);
    border: 1.5px solid rgba(255,255,255,0.1);
  }
  .modal-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

  /* Export checkboxes */
  .export-options { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
  .export-opt {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: rgba(255,255,255,0.7); cursor: pointer;
  }
  .export-opt input[type="checkbox"] { accent-color: #CC1F1F; width: 16px; height: 16px; }
  .export-format { display: flex; gap: 8px; margin-top: 4px; }
  .format-btn {
    flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600;
    border: 1.5px solid rgba(255,255,255,0.1); border-radius: 6px;
    background: transparent; color: rgba(255,255,255,0.5); cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .format-btn:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
  .format-btn.active { border-color: #CC1F1F; color: #CC1F1F; background: rgba(204,31,31,0.08); }

  /* ---- ADMIN BAR ---- */
  .admin-bar {
    display: none;
    background: linear-gradient(90deg, #1a0505, #111);
    border-bottom: 1px solid rgba(204,31,31,0.25);
    padding: 8px 2.5rem;
    align-items: center;
    justify-content: space-between;
  }
  .admin-bar.visible { display: flex; }
  .admin-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #CC1F1F;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .admin-bar-left i { font-size: 16px; }
  .admin-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 4px;
    border: 1px solid rgba(204,31,31,0.4);
    background: rgba(204,31,31,0.1);
    color: #CC1F1F;
    cursor: pointer;
    transition: background 0.15s;
  }
  .admin-btn:hover { background: rgba(204,31,31,0.2); }
  .admin-btn i { font-size: 14px; }

  .admin-badge {
    display: none;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #CC1F1F;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
  }
  .admin-badge.visible { display: inline-block; }

  /* Editable elements in admin mode */
  .editable {
    cursor: default;
    transition: outline 0.15s;
    border-radius: 4px;
  }

  /* Status dropdown for admin */
  .status-select {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #1A1A1A;
    color: #fff;
    cursor: pointer;
    outline: none;
    appearance: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .status-badge-static { display: none; }

  .save-toast {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #166534;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    align-items: center;
    gap: 8px;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  }
  .save-toast.visible { display: flex; }
  .save-toast i { font-size: 18px; }

  /* ---- BOTTOM BAR ---- */
  .main { flex: 1; }

  .bottombar {
    background: #000;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 12px 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
  }

  .approval-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .approval-card:last-child { border-bottom: none; }
  .approval-thumb { width: 64px; height: 44px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #1a1a1a; }
  .approval-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .approval-info { flex: 1; min-width: 0; }
  .approval-info strong { display: block; font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .approval-info span { font-size: 11px; color: rgba(255,255,255,0.62); }
  .approval-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .approval-btn { padding: 6px 14px; font-size: 12px; font-weight: 700; border-radius: 5px; border: none; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; }
  .approval-btn.approve { background: rgba(34,197,94,0.15); color: #22C55E; }
  .approval-btn.approve:hover { background: rgba(34,197,94,0.25); }
  .approval-btn.deny { background: rgba(239,68,68,0.15); color: #EF4444; }
  .approval-btn.deny:hover { background: rgba(239,68,68,0.25); }
  body.light .approval-card { border-bottom-color: #E8E8E8; }
  body.light .approval-info strong { color: #111; }
  body.light .approval-info span { color: #888; }

  .application-card {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .application-card:last-child { border-bottom: none; }
  .app-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
  }
  .app-row:last-child { margin-bottom: 0; }
  .app-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.62);
    min-width: 60px;
  }
  .app-value {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
  }
  .app-status-badge {
    font-weight: 700;
    text-transform: capitalize;
    font-size: 12px;
  }
  .app-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: #fff;
    flex: 1;
    max-width: 300px;
  }
  .app-input:focus {
    outline: none;
    border-color: #CC1F1F;
  }
  .app-brands-wrap { position: relative; flex: 1; max-width: 360px; }
  .app-brands-toggle {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    min-height: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    position: relative;
  }
  .app-brands-toggle::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(255,255,255,0.65);
  }
  .app-brands-toggle .brand-tag {
    background: rgba(204,31,31,0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
  }
  .app-brands-toggle .brand-placeholder { color: rgba(255,255,255,0.6); }
  .app-brands-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1A1A1A;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 50;
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
  }
  .app-brands-dropdown.open { display: block; }
  .app-brands-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: background 0.1s;
  }
  .app-brands-option:hover { background: rgba(255,255,255,0.06); }
  .app-brands-option input[type="checkbox"] { accent-color: #CC1F1F; }
  body.light .app-brands-toggle { background: #fff; border-color: #DDD; color: #111; }
  body.light .app-brands-toggle::after { border-top-color: #999; }
  body.light .app-brands-toggle .brand-tag { background: rgba(204,31,31,0.1); color: #CC1F1F; }
  body.light .app-brands-toggle .brand-placeholder { color: #AAA; }
  body.light .app-brands-dropdown { background: #fff; border-color: #E0E0E0; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
  body.light .app-brands-option { color: #333; }
  body.light .app-brands-option:hover { background: #F5F5F5; }
  .app-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }
  .app-actions .btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    transition: all 0.15s;
  }
  .app-actions .btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
  .app-actions .app-approve { border-color: rgba(34,197,94,0.3); color: #22C55E; }
  .app-actions .app-approve:hover { background: rgba(34,197,94,0.15); }
  .app-actions .app-reject { border-color: rgba(239,68,68,0.3); color: #EF4444; }
  .app-actions .app-reject:hover { background: rgba(239,68,68,0.15); }

  body.light .application-card { border-bottom-color: #E8E8E8; }
  body.light .app-label { color: #999; }
  body.light .app-value { color: #333; }
  body.light .app-input { background: #fff; border-color: #DDD; color: #111; }
  body.light .app-actions .btn { background: #F5F5F5; border-color: #DDD; color: #555; }
  body.light .app-actions .btn:hover { background: #E8E8E8; color: #111; }
  .bottombar-left { font-size: 11px; color: rgba(255,255,255,0.6); }
  .bottombar-right { display: flex; gap: 20px; }
  .bottombar-right a { font-size: 11px; color: rgba(255,255,255,0.6); text-decoration: none; cursor: pointer; }
  .bottombar-right a:hover { color: rgba(255,255,255,0.6); }

  /* ---- RESPONSIVE ---- */
  @media (max-width: 1100px) {
    .content-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 768px) {
    .topnav { padding: 0 1rem; }
    .topnav-left { gap: 1rem; }
    .nav-links { display: none; }
    .main { padding: 1.5rem 1.25rem; }
    .topnav-right { gap: 8px; }
    .user-name { display: none; }
    .user-pill .ti-chevron-down { display: none; }
    .user-pill { padding: 3px; }
    .logo { font-size: 18px; }
    .nav-icon-btn { width: 32px; height: 32px; font-size: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .welcome-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .bottombar { padding: 12px 1.25rem; flex-direction: column; gap: 8px; text-align: center; }
    .admin-bar { padding: 8px 1.25rem; flex-wrap: wrap; gap: 8px; }
    .admin-bar-left { font-size: 11px; gap: 6px; }
    .admin-bar-right { gap: 6px; }
    .admin-bar-right .btn { padding: 6px 10px; font-size: 10px; }
    .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .listings-table { min-width: 650px; }
    .sales-summary { flex-wrap: wrap; }
    .sales-summary-item { min-width: 100px; flex: 1 1 30%; }
    .sale-form-grid { grid-template-columns: 1fr; }
    .sale-item { flex-wrap: wrap; gap: 8px; }
  }
  @media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
  }

  .audit-entry { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #1a1a1a; font-size: 13px; }
  .audit-entry:last-child { border-bottom: none; }
  .audit-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
  .audit-icon.change { background: rgba(59,130,246,0.15); color: #3b82f6; }
  .audit-icon.approve { background: rgba(34,197,94,0.15); color: #22c55e; }
  .audit-icon.reject { background: rgba(239,68,68,0.15); color: #ef4444; }
  .audit-icon.delete { background: rgba(239,68,68,0.15); color: #ef4444; }
  .audit-icon.create { background: rgba(168,85,247,0.15); color: #a855f7; }
  .audit-body { flex: 1; min-width: 0; }
  .audit-body strong { color: #fff; }
  .audit-body .audit-desc { color: #999; margin-top: 2px; }
  .audit-body .audit-values { margin-top: 4px; font-size: 12px; color: #666; }
  .audit-body .audit-values .old { color: #ef4444; text-decoration: line-through; margin-right: 6px; }
  .audit-body .audit-values .new { color: #22c55e; }
  .audit-time { color: #555; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .audit-empty { padding: 24px 16px; text-align: center; color: #555; font-size: 13px; }

  /* Security grid: Login Log + Account & Security side-by-side */
  #securityGrid { display: none; }
  #securityGrid.open { display: grid; }
  @media (max-width: 900px) {
    #securityGrid.open { grid-template-columns: 1fr; }
  }

    /* ==========================
     Analytics dashboard (GA-style)
     ========================== */
  .analytics-main {
    max-width: none !important;
    padding-left: 32px;
    padding-right: 32px;
  }
  @media (max-width: 900px) {
    .analytics-main { padding-left: 16px; padding-right: 16px; }
  }

  /* Range picker */
  #analyticsRange {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  /* Top tabs (Acquisition / Audience style) */
  .analytics-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin: 4px 0 20px;
    overflow-x: auto;
  }
  body.light .analytics-tabs { border-bottom-color: rgba(0,0,0,0.08); }
  .analytics-tab {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.55);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    font-family: inherit;
  }
  body.light .analytics-tab { color: #666; }
  .analytics-tab:hover { color: #CC1F1F; }
  .analytics-tab.active {
    color: #CC1F1F;
    border-bottom-color: #CC1F1F;
  }

  /* Section wrapper */
  .analytics-section { display: block; }

  /* Hero row: primary chart 2fr + secondary donut 1fr */
  .analytics-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }
  @media (max-width: 1100px) {
    .analytics-hero { grid-template-columns: 1fr; }
  }
  .hero-panel { padding: 0; }
  .hero-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  body.light .hero-panel .panel-header { border-bottom-color: rgba(0,0,0,0.06); }
  .hero-panel .panel-title { font-size: 15px; font-weight: 700; }

  /* Chart switcher (interchangeable charts) */
  .chart-switcher {
    display: inline-flex;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 2px;
  }
  body.light .chart-switcher {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
  }
  .chart-sw-btn {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.6);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
  }
  body.light .chart-sw-btn { color: #555; }
  .chart-sw-btn:hover { color: #fff; }
  body.light .chart-sw-btn:hover { color: #000; }
  .chart-sw-btn.active {
    background: #CC1F1F;
    color: #fff;
  }

  .chart-wrap { width: 100%; padding: 16px 20px 20px; overflow-x: auto; }
  .chart-wrap svg { display: block; width: 100%; height: auto; }
  .chart-wrap-lg svg { min-height: 260px; }

  /* Donut chart */
  .donut-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
  }
  .donut-chart {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    position: relative;
  }
  .donut-chart svg { width: 100%; height: 100%; }
  .donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }
  .donut-center-val { font-size: 22px; font-weight: 700; }
  .donut-center-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .05em; }
  body.light .donut-center-label { color: #666; }
  .donut-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
  }
  .donut-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .donut-legend .swatch {
    width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
    display: inline-block;
    margin-right: 8px;
  }
  .donut-legend .name { flex: 1; color: rgba(255,255,255,0.75); }
  body.light .donut-legend .name { color: #333; }
  .donut-legend .value { font-weight: 700; }

  /* KPI tile row (Sessions, Avg Session, %New, Bounce, Goal, Pages) */
  .kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
  .kpi-tile {
    background: #1A1A1A;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 18px 20px;
    position: relative;
    transition: border-color .15s;
  }
  body.light .kpi-tile {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  }
  .kpi-tile.active { border-color: #CC1F1F; }
  .kpi-tile-label { font-size: 12px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
  body.light .kpi-tile-label { color: #666; }
  .kpi-tile-val { font-size: 26px; font-weight: 700; line-height: 1.1; }
  .kpi-tile-delta {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
  }
  .kpi-tile-delta.up { background: rgba(34,197,94,0.15); color: #22C55E; }
  .kpi-tile-delta.down { background: rgba(239,68,68,0.15); color: #EF4444; }
  .kpi-tile-delta.flat { background: rgba(148,163,184,0.15); color: #94A3B8; }

  /* Analytics data table */
  .analytics-table-wrap { overflow-x: auto; }
  .analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .analytics-table th, .analytics-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  body.light .analytics-table th, body.light .analytics-table td {
    border-bottom-color: rgba(0,0,0,0.06);
  }
  .analytics-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(255,255,255,0.5);
    font-weight: 700;
    background: transparent;
  }
  body.light .analytics-table th { color: #666; }
  .analytics-table tbody tr:hover { background: rgba(255,255,255,0.02); }
  body.light .analytics-table tbody tr:hover { background: rgba(0,0,0,0.02); }
  .analytics-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

  .analytics-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: 13px;
  }
  body.light .analytics-empty { color: #666; }

  /* SVG chart primitives */
  .chart-axis { stroke: rgba(255,255,255,0.08); stroke-width: 1; }
  body.light .chart-axis { stroke: rgba(0,0,0,0.08); }
  .chart-label { fill: rgba(255,255,255,0.55); font-size: 11px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
  body.light .chart-label { fill: #666; }
  .chart-bar { fill: #CC1F1F; }
  .chart-bar-alt { fill: #3B82F6; }
  .chart-bar-green { fill: #22C55E; }
  .chart-line { fill: none; stroke: #3B82F6; stroke-width: 2.5; }
  .chart-line-secondary { fill: none; stroke: #93C5FD; stroke-width: 2; }
  .chart-area { fill: rgba(59,130,246,0.12); stroke: none; }
  .chart-dot { fill: #3B82F6; }
