/* ==========================================================================
   CLOSER DASHBOARD STYLES
   ========================================================================== */
.main-container, .inner-container, .c-wrapper, .row, .column, .section { background-color: var(--bg-body) !important; background: var(--bg-body) !important; padding: 0 !important; margin: 0 !important; border: none !important; max-width: 100% !important; }

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

:root {
    --bg-body: #f5f5f7; 
    --bg-card: #ffffff; 
    --bg-input: #f5f5f7;
    --bg-hover: #e5e5ea;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --border: #d2d2d7;
    --border-light: #e5e5ea;
    
    --accent-primary: #000000;
    --accent-text: #ffffff;

    --sys-green: #34c759;
    --sys-red: #ff3b30;
    --sys-blue: #007aff;
    --sys-orange: #ff9500;
    --sys-gold: #ffcc00;
    
    --slider-color: #007aff;
    --modal-bg: rgba(0,0,0,0.4);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow-subtle: 0 4px 24px rgba(0,0,0,0.04);
    --radius: 16px;
    
    --left-panel-w: 1fr;
    --right-panel-w: 1fr;
}

[data-theme="dark"] {
    --bg-body: #000000; 
    --bg-card: #1c1c1e; 
    --bg-input: #2c2c2e;
    --bg-hover: #3a3a3c;
    --text-main: #f5f5f7;
    --text-muted: #98989d;
    --border: #38383a;
    --border-light: #2c2c2e;
    
    --accent-primary: #ffffff;
    --accent-text: #000000;

    --modal-bg: rgba(0,0,0,0.7);
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-subtle: none;
}

html, body { background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; height: auto !important; overflow-y: auto !important; overflow-x: hidden; width: 100vw; transition: background-color 0.3s ease; }

.dashboard-wrapper { padding: 15px 20px 30px 20px; display: flex; flex-direction: column; gap: 20px; }

.top-bar { display: flex; flex-direction: column; gap: 15px; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 15px 24px; border-radius: var(--radius); border: 1px solid var(--glass-border); box-shadow: var(--shadow-subtle); z-index: 100; transition: background 0.3s ease;}
.top-bar-content { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; width: 100%; }

.top-left { display: flex; align-items: center; gap: 15px; justify-self: start; flex-wrap: wrap; }
.top-center { display: flex; justify-content: center; justify-self: center; }
.top-right { display: flex; align-items: center; gap: 12px; justify-self: end; flex-wrap: wrap; }

.kpi-strip { display: flex; gap: 16px; background: var(--bg-input); border: 1px solid var(--border-light); padding: 6px 16px; border-radius: 12px; font-size: 0.75em; font-weight: 600; flex-wrap: wrap; align-items: center;}
.kpi-item { display: flex; align-items: center; gap: 6px; color: var(--text-main); }
.kpi-icon { font-size: 1.1em; opacity: 0.8; }

.user-badge { font-size: 0.8em; color: var(--text-main); background: var(--bg-input); border: 1px solid var(--border-light); padding: 6px 12px; border-radius: 8px; font-weight: 500;}
.btn-settings { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 0.75em; font-weight:500; color: var(--text-main); transition: 0.2s;}
.btn-settings:hover { background: var(--bg-hover); }

.timer-container { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); padding: 6px 20px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.02);}
#timerDisplay { font-weight: 600; font-family: monospace; font-size: 1.3em; color: var(--text-main); letter-spacing: 1px;}
.timer-reset { background: none; border: none; cursor: pointer; font-size: 1.1em; color: var(--text-muted); padding: 0; transition: 0.2s;}
.timer-reset:hover { color: var(--sys-red); }

.progress-wrapper { background: var(--bg-input); border-radius: 8px; height: 18px; position: relative; overflow: hidden; border: 1px solid var(--border-light); width: 100%; }
.progress-fill { height: 100%; width: 0%; transition: width 0.5s ease, background-color 0.5s ease; }
.progress-text { font-size: 0.7em; font-weight: 700; color: #1d1d1f; z-index: 2; }

header { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; background: var(--bg-card); padding: 20px 24px; border-radius: var(--radius); box-shadow: var(--shadow-subtle); border: 1px solid var(--border-light); transition: background 0.3s ease; position: relative;}
.header-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px;}
.header-group label { font-size: 0.65em; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.dropdown-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

select.calc-input, input.calc-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); color: var(--text-main); box-sizing: border-box; font-family: inherit; font-size: 0.85em; outline: none; transition: all 0.2s ease; }
.calc-input:focus { background: var(--bg-card); border-color: var(--sys-blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); }

.sit-tag { background: var(--bg-input); border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px; font-size: 0.75em; font-weight: 500; cursor: pointer; transition: 0.2s; color: var(--text-main); user-select: none; display: inline-flex; align-items: center;}
.sit-tag:hover { background: var(--bg-hover); }
.sit-tag.active { background: var(--sys-blue); color: #fff; border-color: var(--sys-blue); }

.search-row { display: flex; gap: 8px; margin-top: 8px; }
.search-btn { flex: 1; padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.7em; font-weight: 500; cursor: pointer; text-align: center; text-decoration: none; color: var(--text-main); background: var(--bg-card); transition: 0.2s; opacity: 0.6; pointer-events: none; }
.search-btn.active { opacity: 1; pointer-events: auto; }
.search-btn.active:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.search-btn.map-prev { font-weight: 600; color: var(--sys-blue); border-color: var(--sys-blue); }

input[type=range] { width: 100%; cursor: pointer; height: 6px; border-radius: 4px; background: var(--bg-input); outline: none; -webkit-appearance: none; margin-top: 10px;}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--slider-color); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: background 0.3s ease; }
.stage-labels { display: flex; justify-content: space-between; font-weight: 500; margin-top: 10px; font-size: 0.7em; color: var(--text-muted); }
.active-stage { color: var(--text-main); font-weight: 700; transition: 0.3s;}

.end-call-container { display: flex; align-items: center; gap: 15px; margin-top: 20px; }
.btn-complete { flex: 1; background: var(--accent-primary); color: var(--accent-text); border: none; padding: 12px; border-radius: 999px; font-weight: 500; cursor: pointer; font-size: 0.9em; transition: transform 0.2s, opacity 0.2s; font-family: inherit;}
.btn-complete:hover { transform: scale(0.98); opacity: 0.9; }
.btn-sync { background: rgba(0, 122, 255, 0.1); color: var(--sys-blue); border: 1px solid var(--sys-blue); padding: 12px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.3s; width: 100%; font-size: 0.95em;}
.btn-sync:hover { background: var(--sys-blue); color: #fff; }

.main-content { display: grid; grid-template-columns: var(--left-panel-w) 1.4fr var(--right-panel-w); gap: 24px; flex: 1; min-height: 0; transition: all 0.3s ease; }

.card { background: var(--bg-card); padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow-subtle); border: 1px solid var(--border-light); display: flex; flex-direction: column; min-height: 550px; overflow-y: hidden; transition: all 0.3s ease; position: relative;}

.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px;}
.card-header-flex h3 { margin: 0; border: none; padding: 0; font-size: 1.05em; color: var(--text-main); font-weight: 600;}

.toggle-panel-btn { background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: 0.2s; height: 28px; width: 28px;}
.toggle-panel-btn:hover { background: var(--bg-hover); color: var(--text-main); border-color: var(--text-main); }
.toggle-panel-btn svg { width: 16px; height: 16px; stroke: currentColor; }

.card.collapsed { cursor: pointer; min-height: auto; }
.card.collapsed .panel-inner-content { display: none !important; }

.side-panel.collapsed { padding: 15px 5px; align-items: center; }
.side-panel.collapsed .toggle-panel-btn { margin-bottom: 20px; }

.bottom-panel.collapsed { padding: 15px 24px; }
.bottom-panel.collapsed .toggle-panel-btn { margin-bottom: 0; }

.vertical-text { display: none; writing-mode: vertical-rl; text-orientation: mixed; color: var(--text-muted); font-weight: 600; font-size: 0.9em; letter-spacing: 2px;}
.side-panel.collapsed .vertical-text { display: block; }

.section-header { font-size: 0.7em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 12px 0 8px 0; font-weight: 600; flex-shrink: 0;}

.panel-tabs { display: flex; background: var(--bg-input); padding: 4px; border-radius: 10px; margin-bottom: 15px; flex-shrink: 0; }
.tab-btn { flex: 1; padding: 8px 4px; border: none; background: transparent; border-radius: 7px; font-weight: 500; cursor: pointer; color: var(--text-muted); font-size: 0.7em; text-align: center; transition: all 0.2s;}
.tab-btn.active { background: var(--bg-card); color: var(--text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.06); font-weight: 600;}

#rebuttalContainer, #otherRebuttalContainer, #rrContainer, #negContainer { display: flex; flex-wrap: wrap; gap: 8px; }
.script-item { flex: 1 1 calc(50% - 8px); min-width: 130px; background: var(--bg-card); border: 1px solid var(--border); padding: 12px; border-radius: 10px; cursor: pointer; transition: all 0.2s; color: var(--text-main); font-size: 0.75em; line-height: 1.4;}
.script-item:hover { border-color: var(--sys-blue); box-shadow: 0 4px 12px rgba(0,0,0,0.05); transform: translateY(-1px);}

.stage-nav-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-shrink: 0;}
.nav-btn { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-weight: 600; font-size: 1em; display: flex; align-items: center; justify-content: center; transition: 0.2s;}
.nav-btn:hover { background: var(--bg-hover); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.center-scroll-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; padding-right: 5px;}

.stage-guide { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; color: var(--text-main); flex-shrink: 0;}
.stage-guide p { margin: 0 0 12px 0; font-size: 0.9em; line-height: 1.6; color: var(--text-muted); }
.script-box { background: var(--bg-input); border-left: 3px solid var(--accent-primary); padding: 12px 16px; margin-bottom: 15px; border-radius: 0 8px 8px 0; font-size: 0.9em; line-height: 1.5;}
.script-box strong { color: var(--text-main); display: block; margin-bottom: 6px; font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;}

.checklist-wrapper { background: var(--bg-input); border: 1px solid var(--border-light); border-radius: 12px; padding: 15px; flex-shrink: 0;}
.checklist-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px;}
.hidden { display: none !important; }

.checkpoint-box { background: var(--bg-card); border: 1px solid var(--border); padding: 12px; border-radius: 10px; margin-bottom: 8px; font-size: 0.8em; color: var(--text-muted); line-height: 1.4; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; transition: 0.2s;}
.checkpoint-box:hover { border-color: var(--sys-blue); }
.checkpoint-box strong { color: var(--text-main); display: block; margin-bottom: 2px; font-size: 0.95em; font-weight: 600;}
.checkpoint-box input[type="checkbox"] { margin-top: 4px; cursor: pointer; width: 16px; height: 16px; accent-color: var(--sys-green);}

textarea { flex-shrink: 0; width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-family: inherit; resize: vertical; height: 110px; background: var(--bg-input); color: var(--text-main); font-size: 0.85em; outline: none; transition: 0.2s; margin-top: 5px; line-height: 1.5;}
textarea:focus { background: var(--bg-card); border-color: var(--sys-blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);}

.calc-group { margin-bottom: 12px; }
.calc-group label { display: block; font-size: 0.65em; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; flex-shrink: 0;}
.calc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; flex-shrink: 0;}
.calc-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; flex-shrink: 0;}

.calc-results { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; font-size: 0.8em; flex: 1; overflow-y: auto;}
.res-row { display: flex; justify-content: space-between; margin-bottom: 8px; border-bottom: 1px solid var(--border-light); padding-bottom: 6px; color: var(--text-muted);}
.res-row span:last-child { color: var(--text-main); font-weight: 500;}
.res-row.bold { font-weight: 600; font-size: 1.05em; border-bottom: none; margin-top: 12px; padding-bottom: 0;}
.res-sub { display: flex; justify-content: space-between; font-size: 0.85em; color: var(--text-muted); padding-bottom: 6px; }

.logic-check { padding: 12px; border-radius: 8px; font-weight: 600; text-align: center; margin-top: 15px; font-size: 0.85em; letter-spacing: 0.5px;}
.logic-pass { background: rgba(52, 199, 89, 0.1); color: var(--sys-green); border: 1px solid rgba(52, 199, 89, 0.3);}
.logic-fail { background: rgba(255, 38, 0, 0.1); color: var(--sys-red); border: 1px solid rgba(255, 38, 0, 0.3);}

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--sys-green); }
input:checked + .slider:before { transform: translateX(20px); }
[data-theme="dark"] .slider { background-color: #3a3a3c; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--modal-bg); justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal-content { background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); color: var(--text-main); padding: 32px; border-radius: 20px; width: 600px; max-width: 90%; position: relative; border: 1px solid var(--glass-border); box-shadow: 0 24px 48px rgba(0,0,0,0.1); max-height: 85vh; overflow-y: auto; transition: background 0.3s ease; }
.modal-close { position: absolute; top: 20px; right: 24px; font-size: 1.8em; font-weight: 300; cursor: pointer; color: var(--text-muted); transition: 0.2s; line-height: 1;}
.modal-close:hover { color: var(--sys-red); }
.variation-box { background: var(--bg-input); border-left: 3px solid var(--accent-primary); padding: 16px; border-radius: 0 8px 8px 0; margin-bottom: 15px; font-size: 0.95em; line-height: 1.6; }
.why-it-works { font-size: 0.85em; color: var(--text-muted); background: var(--bg-hover); border-left: 3px solid var(--text-muted); padding: 12px; border-radius: 0 6px 6px 0; display: block; margin-top: 10px; line-height: 1.5;}

.disp-btn { display: block; width: 100%; padding: 14px; margin-bottom: 12px; background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border); border-radius: 12px; font-weight: 500; cursor: pointer; font-size: 1em; transition: 0.2s; font-family: inherit;}
.disp-btn:hover { background: var(--bg-card); border-color: var(--accent-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.disp-btn-sec { display: block; width: 100%; padding: 10px; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); border-radius: 8px; font-weight: 500; cursor: pointer; font-size: 0.85em; transition: 0.2s; font-family: inherit;}
.disp-btn-sec:hover { background: var(--bg-input); border-color: var(--text-muted); }
.dial-btn { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2em; font-weight: 500; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.2s;}
.dial-btn:hover { background: var(--bg-card); border-color: var(--accent-primary);}

@media (max-width: 1000px) {
    .top-bar { padding: 15px; }
    .top-bar-content { grid-template-columns: 1fr; justify-items: center; gap: 15px;}
    .top-left, .top-right { justify-self: center; justify-content: center; }
    header { grid-template-columns: 1fr; }
    .dropdown-row { grid-template-columns: 1fr; }
    .main-content { grid-template-columns: 1fr; }
    .card { min-height: 500px;}
}