/* FILE: /sistem-advtrack/dashboard/components/dashboard-global.css */
/* Centralized Global Stylesheet — MalasRibet Advanced Tracking */

:root {
    /* Dimensi & Warna Sidebar */
    --sb-width: 250px;
    --sb-width-collapsed: 64px;
    --sb-bg: #ffffff;
    --sb-border: #dadce0;
    --sb-text: #3c4043;
    --sb-active: #e8f0fe;
    --sb-active-text: #1967d2;

    /* Warna Dashboard Universal */
    --bg-page: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #f6f8fa;
    --text-main: #24292e;
    --text-muted: #57606a;
    --border-color: #e1e4e8;
    --border-input: #d0d7de;

    /* Aksen & Status */
    --primary: #1967d2;
    --primary-alt: #0366d6;
    --success: #238636;
    --success-hover: #2ea043;
    --danger: #cb2431;
    --warning: #b08800;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-left: var(--sb-width) !important;
    transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-is-collapsed {
    padding-left: var(--sb-width-collapsed) !important;
}

/* =========================================================
   1. PEMBUNGKUS & GRID UTAMA
   ========================================================= */
.main-layout-wrapper {
    width: 100%;
    padding: 20px 25px;
    box-sizing: border-box;
}

.container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

/* =========================================================
   2. FORM, TOMBOL & BADGE
   ========================================================= */
.search-box { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
select, input[type=text], input[type=number], input[type=password], input[type=time], input[type=date], textarea {
    padding: 9px 12px;
    border: 1px solid var(--border-input);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 901px) {
    .search-box select, .search-box input[type=text] {
        width: auto !important;
        flex: 0 1 auto;
    }
}
select { background-color: #f9f9f9; }
.sel-klien { width: 200px; }
.sel-preset { width: 160px; font-weight: 700; color: var(--primary-alt); }

.btn { padding: 8px 15px; border-radius: 6px; text-decoration: none; font-weight: 700; cursor: pointer; border: none; font-size: 13px; display: inline-block; transition: 0.2s ease; text-align: center; }
.btn-primary { background: var(--success); color: #fff; } .btn-primary:hover { background: var(--success-hover); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-main); border: 1px solid #d1d5da; } .btn-secondary:hover { background: var(--border-color); }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { background: #a31d27; }
.btn-delete { background: #ffeef0; color: var(--danger); padding: 4px 8px; border-radius: 4px; text-decoration: none; font-size: 12px; border: 1px solid #f8acaf; transition: .2s; display: inline-block; }
.btn-delete:hover { background: var(--danger); color: #fff; }
.btn-resubmit { background: #f0f6fc; color: var(--primary-alt); padding: 4px 8px; border-radius: 4px; text-decoration: none; font-size: 12px; border: 1px solid #c8e1ff; transition: .2s; display: inline-block; margin-top: 6px; }
.btn-resubmit:hover { background: var(--primary-alt); color: #fff; }
.export-btns { display: flex; gap: 10px; }

.badge-ads { background: #e1effe; color: #0366d6; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-fb { background: #e6f2ff; color: #1877f2; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-ig { background: #fce6f5; color: #e1306c; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-tiktok { background: #e6e6e6; color: #000; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-twitter { background: #e1f0fa; color: #1da1f2; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-youtube { background: #fce8e6; color: #ff0000; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-direct { background: #f6f8fa; color: #57606a; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge-organic { background: #e6ffed; color: #22863a; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.text-rcv { color: #d73a49; font-weight: 700; }
.text-sent { color: #28a745; font-weight: 700; }
.text-warn { color: #b08800; font-weight: 700; }

/* =========================================================
   3. TABEL DATA
   ========================================================= */
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
th, td { border: 1px solid var(--border-color); padding: 11px 12px; text-align: left; }
th { background-color: var(--bg-subtle); font-weight: 600; color: var(--text-main); }
tr:hover { background-color: #f1f8ff; }
.table-container-responsive { border: none; background: transparent; overflow-x: auto; }

/* =========================================================
   4. PANEL EXTRA (BREAKDOWN & LOOKER)
   ========================================================= */
.hidden-panel { display: none !important; }
.toggle-header { cursor: pointer; user-select: none; transition: background .2s; }
.toggle-header:hover { background: var(--border-color); }
.evo-card { border: 1px solid var(--border-color); padding: 12px; border-radius: 6px; background: #fff; min-width: 220px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.toggle-btn { font-size: 11px; font-weight: 700; color: var(--primary-alt); background: #f1f8ff; border: 1px solid #c8e1ff; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: center; margin-top: auto; transition: .2s; user-select: none; }
.toggle-btn:hover { background: #dbedff; }
.sa-breakdown { margin-top: 15px; padding-top: 10px; max-height: 250px; overflow-y: auto; display: none; border-top: 1px dashed var(--border-color); }
.sa-client-item { margin-bottom: 12px; background: #f8f9fa; border: 1px solid #d1d5da; border-radius: 8px; padding: 12px; }
.sa-client-name { font-weight: 700; color: var(--primary-alt); font-size: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.sa-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-bottom: 6px; color: var(--text-muted); }
.sa-stat-row:last-child { margin-bottom: 0; }
.sa-stat-row span:last-child { font-weight: 800; color: var(--text-main); background: #fff; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border-color); }

.looker-sidebar { position: fixed; top: 0; right: -600px; width: 550px; height: 100vh; background: #fff; box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3); z-index: 9999; transition: right 0.35s ease-in-out; display: flex; flex-direction: column; border-left: 1px solid var(--border-color); }
.looker-sidebar.open { right: 0; }
.looker-header { padding: 15px 20px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.looker-close-btn { background: var(--danger); color: #fff; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: 700; transition: 0.2s; font-size: 12px; }
.looker-close-btn:hover { background: #a31d27; }
.looker-iframe-container { flex-grow: 1; width: 100%; background: var(--bg-page); }
.looker-iframe-container iframe { width: 100%; height: 100%; border: none; }

/* =========================================================
   5. SIDEBAR KIRI GOOGLE ADS STYLE
   ========================================================= */
.ads-sidebar { position: fixed; top: 0; left: 0; width: var(--sb-width); height: 100vh; background: var(--sb-bg); border-right: 1px solid var(--sb-border); display: flex; flex-direction: column; z-index: 1000; transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease; box-shadow: 2px 0 6px rgba(60, 64, 67, 0.08); }
.ads-sidebar.collapsed { width: var(--sb-width-collapsed); }
.sidebar-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--sb-border); gap: 8px; }
.brand-logo-wrap { display: flex; flex-direction: column; justify-content: center; text-decoration: none; overflow: hidden; flex: 1; min-width: 0; }
.brand-logo-img { max-width: 175px; width: auto; height: auto; object-fit: contain; object-position: left center; display: block; }
.brand-title { font-size: 14px; color: var(--sb-text); display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.brand-tagline { font-size: 11px; color: #5f6368; margin-top: 4px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-dot { width: 10px; height: 10px; background: #1a73e8; border-radius: 50%; flex-shrink: 0; }

/* MOBILE TOP HEADER BAR */
.mobile-top-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--sb-bg);
    border-bottom: 1px solid var(--sb-border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 998;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.mobile-brand-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    min-width: 0;
}
.mobile-brand-logo {
    max-width: 185px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
}
.mobile-brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: var(--sb-text);
    white-space: nowrap;
}
.mobile-brand-tagline {
    font-size: 10.5px;
    color: #5f6368;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-header-menu-btn {
    background: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-header-menu-btn:hover {
    background: var(--border-color);
}
.sidebar-collapse-btn { background: none; border: none; cursor: pointer; font-size: 16px; color: #5f6368; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.sidebar-collapse-btn:hover { background: #f1f3f4; }
.ads-sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
.user-profile-badge { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #f8f9fa; border-bottom: 1px solid var(--sb-border); overflow: hidden; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: #1a73e8; color: #fff; font-weight: bold; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-meta { overflow: hidden; white-space: nowrap; }
.user-name { font-size: 13px; font-weight: 600; color: #202124; text-overflow: ellipsis; overflow: hidden; }
.user-status { font-size: 11px; color: #5f6368; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.nav-category { font-size: 10px; font-weight: 700; color: #70757a; padding: 10px 12px 4px; letter-spacing: 0.5px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; color: #3c4043; text-decoration: none; font-size: 13px; font-weight: 500; border-radius: 20px; white-space: nowrap; transition: background 0.15s ease; }
.nav-item:hover { background: #f1f3f4; }
.nav-item.active { background: var(--sb-active); color: var(--sb-active-text); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.ads-sidebar.collapsed .brand-logo-wrap, .ads-sidebar.collapsed .brand-title, .ads-sidebar.collapsed .brand-tagline, .ads-sidebar.collapsed .user-meta, .ads-sidebar.collapsed .nav-text, .ads-sidebar.collapsed .nav-category { display: none; }
.ads-sidebar.collapsed .nav-item { padding: 10px 11px; border-radius: 50%; justify-content: center; }

.mobile-nav-toggle { display: none; position: fixed; bottom: 20px; right: 20px; z-index: 1001; background: #1a73e8; color: #fff; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); cursor: pointer; }
.sidebar-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.4); z-index: 999; }

/* =========================================================
   6. MODAL & FORM BUILDER (CLIENT MANAGER & GENERATOR)
   ========================================================= */
.alert { padding: 10px 14px; background: #d4edda; color: #155724; border-radius: 6px; margin-bottom: 15px; font-size: 13px; border: 1px solid #c3e6cb; }
.alert-danger { background: #ffeef0; color: var(--danger); border: 1px solid #f8acaf; }
.alert-sgtm { background: #fff3cd; color: #856404; border-left: 4px solid #ffeeba; font-size: 13px; padding: 12px; grid-column: 1 / -1; margin-bottom: 15px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 13px; color: var(--text-main); }
.section-title { grid-column: 1 / -1; background: #e1effe; padding: 8px; font-weight: bold; color: var(--primary-alt); border-radius: 4px; margin-top: 10px; font-size: 13px; }
.radio-group { display: flex; gap: 20px; align-items: center; margin-top: 10px; }
.radio-group label { display: flex; align-items: center; font-weight: 400; cursor: pointer; font-size: 13px; }
.radio-group input { margin-right: 8px; width: auto; }

.btn-generate { background: var(--success); color: #fff; padding: 12px 20px; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; width: 100%; font-size: 16px; margin-top: 10px; transition: .2s; }
.btn-generate:hover { background: var(--success-hover); }
.code-box-container { position: relative; margin-top: 25px; display: none; }
.code-box { background: #161b22; color: #c9d1d9; padding: 20px; border-radius: 8px; font-family: "Courier New", Courier, monospace; font-size: 13px; white-space: pre-wrap; overflow-x: auto; border: 1px solid #30363d; line-height: 1.5; }
.btn-copy { position: absolute; top: 10px; right: 10px; background: var(--success-hover); color: #fff; border: none; padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn-copy:hover { background: #3fb950; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 1100; overflow-y: auto; padding: 20px; box-sizing: border-box; backdrop-filter: blur(2px); }
.modal-content { background: #fff; width: 100%; max-width: 800px; margin: 20px auto; padding: 25px; border-radius: 8px; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; color: #666; transition: 0.2s; }
.close-btn:hover { color: var(--danger); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 1100; }
.modal-box { background: #fff; padding: 35px 30px; border-radius: 8px; max-width: 480px; width: 90%; text-align: center; box-shadow: 0 15px 35px rgba(0, 0, 0, .3); animation: popIn .3s cubic-bezier(.175, .885, .32, 1.275); }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 60px; margin-bottom: 10px; line-height: 1; }
.modal-title { color: var(--danger); font-size: 24px; font-weight: 800; margin: 0 0 15px; border: none; padding: 0; }
.modal-text { color: var(--text-main); font-size: 14.5px; line-height: 1.6; margin-bottom: 25px; text-align: justify; background: #fff8c5; padding: 15px; border-left: 4px solid #e36209; border-radius: 4px; }
.btn-agree { background: var(--danger); color: #fff; border: none; padding: 14px 20px; font-size: 14px; font-weight: 700; border-radius: 6px; cursor: pointer; transition: .2s; width: 100%; }
.btn-agree:hover { background: #a71d2a; }

/* =========================================================
   7. ANNOUNCEMENT MARQUEE BAR (GLOBAL PENGUMUMAN)
   ========================================================= */
.mr-announcement-bar {
    background: #e1effe;
    border: 1px solid #b3d4fc;
    padding: 9px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.mr-announcement-bar.global-top {
    margin: 14px 25px 0 25px;
}
.mr-announcement-bar.inline-top {
    margin-bottom: 20px;
}
.mr-announcement-badge {
    background: var(--primary-alt);
    color: #fff;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
    margin-right: 12px;
    z-index: 2;
}
.mr-announcement-marquee {
    color: var(--primary-alt);
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   8. UNIVERSAL MANAGER CARDS, TABLES & PREVIEW MODAL
   ========================================================= */
.inv-card, .rep-card, .calc-card, .bc-card, .mgr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.inv-card h3, .rep-card h3, .calc-card h3, .bc-card h3, .mgr-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-main);
    border-bottom: 1px solid #eaeef2;
    padding-bottom: 10px;
}
.inv-grid, .rep-grid, .calc-grid, .mgr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}
.inv-field label, .rep-field label, .calc-field label, .mgr-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}
.calc-hint, .mgr-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.inv-table, .rep-table, .mgr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.inv-table th, .inv-table td,
.rep-table th, .rep-table td,
.mgr-table th, .mgr-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 9px 8px;
    text-align: left;
    vertical-align: middle;
}
.inv-table th, .rep-table th, .mgr-table th {
    background: var(--bg-subtle);
    font-weight: 700;
}
.inv-table input[type="number"], .inv-table input[type="text"],
.rep-table input[type="text"] {
    width: 135px;
    padding: 6px 8px;
    border: 1px solid var(--border-input);
    border-radius: 4px;
    font-size: 12.5px;
}
.preview-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    padding: 12px;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.45;
    max-height: 360px;
    overflow-y: auto;
}
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 15px;
}
.modal-backdrop .modal-box {
    background: #fff;
    border-radius: 8px;
    max-width: 540px;
    width: 100%;
    padding: 20px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   9. BROADCAST MANAGER & CUSTOM CSS EDITOR
   ========================================================= */
.bc-grid-main { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.preset-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.preset-btn { background: #f1f8ff; color: var(--primary-alt); border: 1px solid #c8e1ff; padding: 5px 10px; border-radius: 5px; font-size: 12px; font-weight: 700; cursor: pointer; }
.preset-btn:hover { background: var(--primary-alt); color: #fff; }
.target-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--border-input); border-radius: 6px; padding: 8px; background: #f8f9fa; }
.target-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 9px; background: #fff; border: 1px solid var(--border-color); border-radius: 5px; margin-bottom: 6px; font-size: 12.5px; gap: 8px; }
.target-item:last-child { margin-bottom: 0; }
.progress-wrap { display: none; margin-top: 15px; background: var(--bg-subtle); border: 1px solid var(--border-input); border-radius: 8px; padding: 14px; }
.progress-bar-bg { width: 100%; height: 12px; background: var(--border-color); border-radius: 6px; overflow: hidden; margin: 8px 0; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--success); transition: width 0.3s ease; }
.bc-log { max-height: 160px; overflow-y: auto; background: #fff; border: 1px solid var(--border-color); border-radius: 5px; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; margin-top: 8px; }

.css-code-editor {
    width: 100%;
    min-height: 360px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.55;
    tab-size: 4;
    background: #161b22;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px 16px;
    resize: vertical;
}
.css-code-editor:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

@media (max-width: 980px) {
    .bc-grid-main { grid-template-columns: 1fr; }
}

/* =========================================================
   10. KALKULATOR FEE & ANGGARAN IKLAN (kalkulator-fee.php)
   ========================================================= */
.calc-wrap {
    max-width: 720px;
    margin: 15px auto 30px auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.calc-client-bar {
    background: var(--bg-subtle);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.calc-client-bar select { width: auto; min-width: 210px; background: #fff; font-weight: 600; }
.calc-mode-tabs { display: flex; background: var(--bg-subtle); padding: 4px; border-radius: 8px; border: 1px solid var(--border-input); margin-bottom: 18px; gap: 4px; }
.calc-tab-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 9px 12px; font-size: 13.5px; font-weight: 700; border-radius: 6px; cursor: pointer; transition: 0.15s ease; }
.calc-tab-btn:hover { background: #eaeef2; color: var(--text-main); }
.calc-tab-btn.active { background: var(--primary); color: #ffffff; box-shadow: 0 1px 3px rgba(25, 103, 210, 0.3); }
.budget-input-field { padding: 11px 14px !important; font-size: 16px !important; font-weight: 700; color: var(--text-main); border: 1px solid var(--border-input); border-radius: 6px; background: #fff; width: 100%; }
.budget-input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.12); }
.tracking-check-box { display: flex; align-items: center; gap: 10px; background: #f1f8ff; border: 1px solid #c8e1ff; padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; cursor: pointer; user-select: none; font-size: 13.5px; font-weight: 600; color: var(--primary-alt); }
.tracking-check-box input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.calc-breakdown { background: #f8f9fa; border: 1px solid var(--border-color); border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.calc-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid #eaeef2; gap: 10px; }
.calc-row:last-child { border-bottom: none; padding-bottom: 0; }
.calc-row.highlight-topup { background: #e1effe; margin: 6px -10px; padding: 10px; border-radius: 6px; border-bottom: none; font-weight: 700; color: var(--primary-alt); }
.calc-row.highlight-admin { background: #e6ffed; margin: 8px -10px 0 -10px; padding: 10px; border-radius: 6px; border-bottom: none; font-weight: 700; color: #22863a; }
.calc-row .lbl { color: var(--text-muted); }
.calc-row.highlight-topup .lbl { color: var(--primary-alt); }
.calc-row.highlight-admin .lbl { color: #22863a; }
.calc-row .val { font-weight: 700; color: var(--text-main); text-align: right; }
.calc-row.highlight-topup .val { color: var(--primary-alt); font-size: 14.5px; }
.calc-row.highlight-admin .val { color: #22863a; font-size: 14.5px; }
.calc-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 700; margin-left: 6px; background: #eaeef2; color: var(--text-muted); }
.calc-badge.blue { background: #e1effe; color: var(--primary-alt); }
.calc-badge.green { background: #e6ffed; color: #22863a; }
.calc-badge.orange { background: #fff8c5; color: #856404; }
.promo-inline-box { display: none; flex-direction: column; background: #fff8c5; border: 1px solid #f0c36d; border-left: 4px solid var(--warning); border-radius: 6px; padding: 12px 14px; margin: 10px 0; font-size: 12.5px; color: #7c4a03; line-height: 1.5; }
.promo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.calc-grand-box { background: #f1f8ff; border: 1.5px solid var(--primary); border-radius: 10px; padding: 16px 18px; text-align: center; margin-bottom: 18px; }
.calc-grand-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--primary-alt); margin-bottom: 4px; }
.calc-grand-amount { font-size: 26px; font-weight: 800; color: var(--primary); }
.custom-deal-msg { color: var(--warning); font-size: 16px; font-weight: 800; }
.rekening-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.rek-card { background: #ffffff; border: 1px solid var(--border-input); border-radius: 8px; padding: 13px 15px; }
.rek-card.gads { border-left: 4px solid var(--primary); }
.rek-card.fee { border-left: 4px solid var(--success); }
.rek-title { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--text-main); margin-bottom: 8px; }
.rek-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: 6px; padding: 8px 11px; margin-top: 6px; font-size: 13px; }
.rek-item code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--text-main); word-break: break-all; }
.btn-copy-rek { background: #fff; color: var(--primary-alt); border: 1px solid #c8e1ff; border-radius: 5px; padding: 4px 9px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-copy-rek:hover { background: var(--primary-alt); color: #fff; }
.calc-footer-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.calc-footer-actions .btn { padding: 12px 16px; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.send-feedback { display: none; margin-top: 12px; padding: 11px 14px; border-radius: 6px; font-size: 13px; line-height: 1.45; }

/* =========================================================
   11. SCANNER WA & REPORT ANALYTICS (scan-wa.php & report-analytics.php)
   ========================================================= */
.scanner-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.scanner-card { max-width: 420px; width: 100%; text-align: center; padding: 30px 25px; }
.card-logo-header { background: linear-gradient(90deg, #2b11e1 0%, #126ae8 50%, #2ce2ee 100%); padding: 15px; border-radius: 8px; margin-top: -10px; margin-bottom: 25px; box-shadow: 0 4px 12px rgba(18, 106, 232, .25); }
.card-logo-header img { height: 35px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.qr-box { display: flex; justify-content: center; align-items: center; height: 280px; background: #f8f9fa; border: 2px dashed #d1d5da; border-radius: 8px; margin: 20px 0; position: relative; overflow: hidden; }
.qr-box img { height: 100%; padding: 10px; object-fit: contain; display: none; }
.qr-status-text { color: #6a737d; font-size: 14px; padding: 0 20px; }
.success-mark { display: none; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; background: #e6ffed; }
.success-mark svg { width: 70px; height: 70px; color: #22863a; margin-bottom: 10px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)); }
.success-title { color: #22863a; font-weight: 800; font-size: 18px; margin: 0; }
.success-desc { color: #28a745; font-size: 13px; margin-top: 5px; }
.countdown-text { color: var(--danger); font-size: 12.5px; margin-top: 15px; font-weight: 600; display: none; }
.countdown-text span { font-weight: 800; font-size: 14px; }

.report-container { height: 85vh; display: flex; flex-direction: column; }
.iframe-container { flex-grow: 1; width: 100%; border: 1px solid #d1d5da; border-radius: 8px; overflow: hidden; background: #f9f9f9; display: flex; justify-content: center; align-items: center; }
.iframe-container iframe { width: 100%; height: 100%; border: none; display: block; }
.empty-state { text-align: center; color: var(--text-muted); }
.empty-state h3 { color: var(--danger); margin-bottom: 10px; }

/* =========================================================
   12. RESPONSIVE MOBILE & PRINT TWEAKS
   ========================================================= */
@media (max-width: 560px) {
    .calc-wrap { padding: 16px; }
    .calc-footer-actions { grid-template-columns: 1fr; }
}

.print-brand-header {
    display: none;
}

@media print {
    .mr-announcement-bar, .toast-container,
    .search-box, .toggle-header, #evo-panel, .export-btns, .btn-delete, .btn-resubmit, .toggle-btn, .sa-breakdown, .ads-sidebar, .mobile-nav-toggle, .mobile-top-header,
    .calc-mode-tabs, .promo-inline-box, .btn-copy-rek, .calc-footer-actions, .send-feedback, #clientSelectorWrap {
        display: none !important;
    }
    .print-brand-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #1967d2;
        padding-bottom: 12px;
        margin-bottom: 16px;
        gap: 12px;
    }
    body { background: #fff; padding: 0 !important; }
    .container { box-shadow: none; border: none; padding: 0; max-width: 100%; }
    .summary-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
    .card { padding: 10px; }
    .main-layout-wrapper { padding: 0; }
    .calc-wrap { box-shadow: none !important; border: 1px solid #ccc !important; margin: 0 !important; max-width: 100% !important; }
}

@media (max-width: 900px) {
    body, body.sidebar-is-collapsed { padding-left: 0 !important; padding-top: 60px !important; background-color: #fff !important; }
    .main-layout-wrapper { padding: 10px; }
    .container { padding: 10px !important; box-shadow: none !important; border-radius: 0 !important; max-width: 100% !important; }
    .mr-announcement-bar.global-top { margin: 10px 10px 0 10px; }

    .mobile-top-header { display: flex; }
    .mobile-nav-toggle { display: none !important; }
    .ads-sidebar { transform: translateX(-100%); box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15); }
    .ads-sidebar.mobile-open { transform: translateX(0); }
    .sidebar-backdrop.active { display: block; }
    .sidebar-collapse-btn { display: none; }

    .search-box { flex-direction: column; align-items: stretch !important; gap: 12px !important; }
    .search-box select, .search-box input[type=text], .search-box input[type=date], .search-box button { width: 100% !important; max-width: 100% !important; box-sizing: border-box; margin: 0 !important; padding: 12px !important; font-size: 14px !important; }
    .search-box span { display: none !important; }
    .reset-btn { display: block; text-align: center; margin-top: 5px; padding: 10px; font-weight: 700; }
    .export-btns { justify-content: center; width: 100%; margin-bottom: 15px; }
    .export-btns button { flex-grow: 1; padding: 12px !important; }

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

    table, thead, tbody, th, td, tr { display: block; width: 100%; box-sizing: border-box; }
    thead tr { display: none; }
    tbody tr { margin: 0 4px 15px 4px; width: calc(100% - 8px); border: 1px solid #d1d5da; border-radius: 8px; background: #fff; padding: 10px 15px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); cursor: pointer; position: relative; }
    tbody tr::after { content: '🔽 Klik untuk lihat detail'; display: block; text-align: center; font-size: 11px; color: var(--primary-alt); padding: 10px 0 5px 0; font-weight: 700; border-top: 1px dashed var(--border-color); margin-top: 8px; }
    tbody tr.expanded-mobile::after { content: '🔼 Tutup detail'; color: var(--danger); }
    td { display: flex !important; justify-content: space-between; align-items: center; border: none !important; border-bottom: 1px solid var(--bg-subtle) !important; padding: 8px 0 !important; text-align: right; font-size: 13px !important; }
    td:last-child { border-bottom: none !important; }
    td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); text-align: left; flex-basis: 40%; }

    tr:not(.expanded-mobile) .col-waktu-wa,
    tr:not(.expanded-mobile) .col-id-pelacakan,
    tr:not(.expanded-mobile) .col-nomor-wa,
    tr:not(.expanded-mobile) .col-nama-lead,
    tr:not(.expanded-mobile) .col-nama-klien,
    tr:not(.expanded-mobile) .col-aksi { display: none !important; }
}

/* =========================================================
   13. FLOATING ALERTS & SPINNER OVERLAY
   ========================================================= */
.toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast-alert {
    pointer-events: auto;
    min-width: 320px;
    max-width: 400px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
    border-left: 5px solid;
}
.toast-alert.warning { border-left-color: var(--warning); }
.toast-alert.danger { border-left-color: var(--danger); }
.toast-icon { font-size: 20px; line-height: 1.2; }
.toast-content { flex-grow: 1; }
.toast-title { font-weight: 800; font-size: 14px; color: var(--text-main); margin-bottom: 5px; }
.toast-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.toast-close { background: none; border: none; cursor: pointer; color: #999; font-size: 18px; padding: 0; line-height: 1; margin-left: 10px; transition: 0.2s; }
.toast-close:hover { color: var(--danger); transform: scale(1.1); }
@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes mrSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@media (max-width: 900px) {
    .toast-container { top: auto; bottom: 20px; right: 50%; transform: translateX(50%); width: 90%; }
    .toast-alert { min-width: unset; width: 100%; }
    @keyframes slideInRight {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}

/* =========================================================
   14. SLIM ALERT BAR, SIDEBAR BADGE & NOTIFICATION BELL
   ========================================================= */
.sb-nav-badge {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.2;
    flex-shrink: 0;
}
.sb-nav-badge.danger {
    background: #ffeef0;
    color: #cb2431;
    border: 1px solid #f8acaf;
}
.sb-nav-badge.ok {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: #28a745;
}
.ads-sidebar.collapsed .sb-nav-badge {
    display: none !important;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.mr-bell-btn {
    position: relative;
    background: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    margin-left: auto;
}
.mr-bell-btn:hover {
    background: var(--border-color);
    border-color: #b1bac4;
}
.mr-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #cb2431;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    line-height: 1;
}
.ads-sidebar.collapsed .user-profile-badge {
    justify-content: center;
    padding: 12px 8px;
}
.ads-sidebar.collapsed .user-avatar {
    display: none;
}
.ads-sidebar.collapsed .mr-bell-btn {
    margin-left: 0;
}

/* SLIM CONTEXTUAL ALERT STACK (0px bila kosong) */
.mr-alert-stack {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin: 14px 25px 0 25px;
}
.mr-alert-stack.has-items {
    display: flex;
}
.mr-slim-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.4;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.mr-slim-alert.danger {
    background: #fff5f5;
    border-color: #f8acaf;
    border-left: 4px solid #cb2431;
    color: #86181d;
}
.mr-slim-alert.warning {
    background: #fffbeb;
    border-color: #f0c36d;
    border-left: 4px solid #b08800;
    color: #7c4a03;
}
.mr-slim-alert.info {
    background: #f0f7ff;
    border-color: #b3d4fc;
    border-left: 4px solid #1967d2;
    color: #0b4a9f;
}
.mr-slim-body {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.mr-slim-text {
    overflow-wrap: anywhere;
}
.mr-slim-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.mr-slim-cta {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.14);
    color: inherit;
    transition: background 0.15s ease;
}
.mr-slim-cta:hover {
    background: rgba(255, 255, 255, 0.75);
}
.mr-slim-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.65;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
}
.mr-slim-close:hover {
    opacity: 1;
}

/* NOTIFICATION CENTER POPOVER PANEL */
.mr-notif-panel {
    display: none;
    position: fixed;
    top: 74px;
    left: calc(var(--sb-width) + 12px);
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 460px;
    background: #ffffff;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    z-index: 1200;
    flex-direction: column;
    overflow: hidden;
}
body.sidebar-is-collapsed .mr-notif-panel {
    left: calc(var(--sb-width-collapsed) + 12px);
}
.mr-notif-panel.open {
    display: flex;
}
.mr-notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}
.mr-notif-list {
    overflow-y: auto;
    flex: 1;
}
.mr-notif-item {
    display: flex;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #f0f2f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.mr-notif-item:last-child {
    border-bottom: none;
}
.mr-notif-item:hover {
    background: #f6f8fa;
}
.mr-notif-item.is-unread {
    background: #f0f7ff;
}
.mr-notif-ico {
    font-size: 16px;
    line-height: 1.3;
    flex-shrink: 0;
}
.mr-notif-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}
.mr-notif-msg {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}
.mr-notif-time {
    font-size: 10.5px;
    color: #8c959f;
    margin-top: 4px;
}
.mr-notif-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .mr-alert-stack {
        margin: 10px 10px 0 10px;
    }
    .mr-slim-alert {
        flex-wrap: wrap;
        padding: 9px 12px;
    }
    .mr-notif-panel,
    body.sidebar-is-collapsed .mr-notif-panel {
        top: 66px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}

@media print {
    .mr-alert-stack,
    .mr-notif-panel,
    .mr-bell-btn {
        display: none !important;
    }
}