/* F@W Web Dashboard — Theme
   Colours, typography, and component styles ported from desktop + futureatwork.co */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────────────────── */
:root {
    --bg-page:       #001214;
    --bg-website:    #00191c;
    --teal:          #1D9DAE;
    --teal-hover:    #176f7d;
    --light:         #e8f5f7;
    --white:         #ffffff;
    --muted:         rgba(232,245,247,0.7);
    --success:       #27AE60;
    --warning:       #E67E22;
    --danger:        #E74C3C;
    --table-alt:     rgba(29,157,174,0.05);
    --table-hover:   rgba(29,157,174,0.12);
    --table-selected:rgba(29,157,174,0.2);
    --border-subtle: rgba(29,157,174,0.25);
    --border-light:  rgba(29,157,174,0.4);
}

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

html, body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--light);
    background: var(--bg-page);
    height: 100%;
    overflow: hidden;
}

::selection { background: var(--teal); color: var(--bg-page); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-hover); }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    height: 72px;
    min-height: 72px;
    padding: 0 24px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-subtle);
    gap: 14px;
}

.header-logo { height: 44px; }
.header-logo img { height: 44px; }
.header-logo span {
    color: var(--teal); font-size: 22px; font-weight: 900; letter-spacing: 2px;
}

.header-divider {
    width: 1px; height: 36px; background: var(--teal);
}

.header-title {
    color: var(--white); font-size: 17px; font-weight: 600; letter-spacing: 0.5px;
}

.header-spacer { flex: 1; }

.header-user {
    color: var(--muted); font-size: 12px; font-weight: 400;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; border: none; border-radius: 5px;
    font-family: inherit; font-size: 12px; font-weight: 600;
    padding: 6px 18px; transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--teal); color: var(--white);
}
.btn-primary:hover { background: var(--teal-hover); }

.btn-secondary {
    background: var(--light); color: var(--bg-page);
    border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal); color: var(--white); }

.btn-outline {
    background: transparent; color: var(--teal);
    border: 1.5px solid var(--teal); border-radius: 6px;
    padding: 0 16px; height: 36px; font-size: 12px; font-weight: 500;
}
.btn-outline:hover { background: var(--teal); color: var(--bg-page); }

.btn-danger {
    background: var(--danger); color: var(--white);
}
.btn-danger:hover { background: #C0392B; }

.btn-small {
    padding: 4px 12px; font-size: 11px; border-radius: 4px;
}

.btn:disabled {
    opacity: 0.4; cursor: not-allowed;
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
select,
textarea {
    background: var(--bg-page);
    border: 1px solid var(--teal);
    border-radius: 4px;
    color: var(--light);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(29,157,174,0.25);
}

input::placeholder, textarea::placeholder {
    color: var(--muted);
}

input[type="number"] {
    width: 80px;
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Spin box styling */
.spin-box {
    display: inline-flex; align-items: center; gap: 0;
}
.spin-box input {
    width: 60px; text-align: center; border-radius: 4px 0 0 4px;
}
.spin-box .spin-btns {
    display: flex; flex-direction: column;
}
.spin-box .spin-btns button {
    background: var(--teal); color: var(--white); border: none;
    width: 22px; height: 15px; font-size: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.spin-box .spin-btns button:first-child { border-radius: 0 4px 0 0; }
.spin-box .spin-btns button:last-child  { border-radius: 0 0 4px 0; }
.spin-box .spin-btns button:hover { background: var(--teal-hover); }

/* Checkbox */
input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--teal);
    cursor: pointer; margin: 0;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
    display: flex; gap: 6px; padding: 0 24px; background: var(--bg-page);
}

.tab {
    padding: 10px 20px;
    font-size: 14px; font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: none; border-radius: 8px;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.tab:hover { background: rgba(29,157,174,0.1); }
.tab.active {
    background: var(--teal); color: var(--bg-page);
}

/* ─── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex; align-items: center; gap: 10px;
    height: 52px; padding: 0 24px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-light);
}

.filter-bar label {
    color: var(--muted); font-size: 13px; font-weight: 500;
}

.filter-bar select {
    width: 200px; height: 30px;
    background: #071f23; border: 1px solid var(--border-light);
    border-radius: 8px; padding: 2px 12px;
    color: var(--light); font-size: 13px;
}

.filter-bar input[type="search"],
.filter-bar input[type="text"] {
    width: 270px; height: 30px;
    background: #071f23; border: 1px solid var(--border-light);
    border-radius: 8px; padding: 2px 12px;
    color: var(--light); font-size: 13px;
}

.filter-bar .count {
    margin-left: auto;
    color: var(--muted); font-size: 13px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative; display: inline-block;
    width: 48px; height: 26px; cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-track {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #2a3d41; border-radius: 13px; transition: background 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--teal); }
.toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; background: var(--white);
    border-radius: 50%; transition: left 0.2s;
}
.toggle-switch input:checked ~ .toggle-thumb { left: 25px; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-container {
    flex: 1; overflow: auto;
}

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

thead th {
    position: sticky; top: 0; z-index: 5;
    background: var(--bg-page);
    color: var(--teal);
    font-size: 12px; font-weight: 600;
    padding: 10px 8px;
    text-align: left; white-space: nowrap;
    border-bottom: 2px solid var(--teal);
    letter-spacing: 0.3px;
}

thead th.center { text-align: center; }

tbody tr {
    background: transparent;
    transition: background 0.1s;
    cursor: pointer;
}
tbody tr:nth-child(even) { background: var(--table-alt); }
tbody tr:hover { background: var(--table-hover); }
tbody tr.selected { background: var(--table-selected); }

tbody td {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(29,157,174,0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

td.center { text-align: center; }
td.score {
    color: var(--teal); font-weight: 700;
    text-align: center;
}

td.notes-ready   { color: #0d6e52; }
td.notes-linkedin { color: #8e44ad; }
td.notes-progress { color: var(--teal-hover); }

/* ─── Info Banner ────────────────────────────────────────────────────────── */
.info-banner {
    padding: 6px 24px;
    background: rgba(29,157,174,0.08);
    color: var(--muted);
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* ─── Modal / Dialog ─────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,18,20,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-website);
    border: 1px solid var(--teal);
    border-radius: 10px;
    width: 640px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto;
    padding: 0;
}

.modal-wide { width: 800px; }

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

.modal-header h2 {
    font-size: 16px; font-weight: 700; color: var(--white);
}

.modal-header .badge {
    font-size: 11px; padding: 2px 8px; border-radius: 10px;
    background: rgba(29,157,174,0.15); color: var(--teal);
}

.modal-close {
    background: none; border: none; color: var(--muted);
    font-size: 20px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--danger); }

.modal-body { padding: 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
}

/* ─── Group Box ──────────────────────────────────────────────────────────── */
.group-box {
    border: 1px solid var(--teal);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.group-box-title {
    color: var(--teal); font-weight: 600; font-size: 13px;
    margin-bottom: 12px;
}

/* ─── Form Layout ────────────────────────────────────────────────────────── */
.form-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px;
}

.form-row label {
    width: 140px; text-align: right;
    font-size: 12px; color: var(--muted);
    flex-shrink: 0;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row input[type="tel"],
.form-row textarea {
    flex: 1;
    min-width: 0;
}

/* Email / Phone inline row — prevents overflow */
.form-row-inline {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px; min-width: 0;
}
.form-row-inline label {
    flex-shrink: 0; font-size: 12px; color: var(--muted);
}
.form-row-inline label:first-child { width: 140px; text-align: right; }
.form-row-inline input {
    flex: 1; min-width: 0;
    background: var(--bg-page); border: 1px solid var(--teal);
    border-radius: 4px; color: var(--light); padding: 6px 10px;
    font-family: inherit; font-size: 13px; outline: none;
}
.form-row-inline input:focus { box-shadow: 0 0 0 2px rgba(29,157,174,0.25); }

.form-grid {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 8px 10px;
    align-items: center;
}

.form-grid label {
    font-size: 12px; color: var(--muted); text-align: right;
}

/* ─── Checkbox row ───────────────────────────────────────────────────────── */
.checkbox-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--light);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* ─── Score Preview Bar ──────────────────────────────────────────────────── */
.score-preview {
    background: var(--bg-page);
    border: 1.5px solid var(--teal);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex; gap: 24px; align-items: center;
    margin: 12px 0;
}

.score-preview .score-item {
    font-size: 13px; font-weight: 700;
    color: var(--teal); letter-spacing: 0.3px;
}

/* ─── Notes section ──────────────────────────────────────────────────────── */
.notes-indicator {
    font-size: 11px;
}
.notes-indicator.auto { color: var(--success); }
.notes-indicator.manual { color: var(--warning); }

/* ─── Session/Interaction Cards ──────────────────────────────────────────── */
.session-card {
    background: var(--bg-page);
    border: 1px solid var(--teal);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.session-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}

.session-card-header .meta {
    font-size: 12px; color: var(--light);
}
.session-card-header .meta b { color: var(--teal); }

.session-card-summary {
    font-size: 12px; color: var(--light);
    line-height: 1.4;
}

.session-delete {
    background: transparent; border: none;
    color: var(--danger); font-size: 14px; font-weight: 700;
    cursor: pointer; padding: 2px 6px;
}
.session-delete:hover { color: #C0392B; }

/* ─── Funnel Stage Badges ────────────────────────────────────────────────── */
.stage-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px; font-weight: 600;
    white-space: nowrap;
}

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--teal);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin: 0 auto 12px;
}

.avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.avatar-placeholder {
    color: var(--white); font-size: 32px; font-weight: 700;
}

/* ─── CSV Preview Table ──────────────────────────────────────────────────── */
.csv-preview-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px; margin: 12px 0;
}

.csv-preview-table th {
    background: var(--bg-page); color: var(--teal);
    padding: 6px 8px; text-align: left;
    border-bottom: 1px solid var(--teal);
}

.csv-preview-table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.csv-preview-table .matched { background: rgba(39,174,96,0.1); }
.csv-preview-table .unmatched { background: rgba(231,76,60,0.1); }

/* ─── Toast / Notification ───────────────────────────────────────────────── */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}

.toast {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); color: var(--white); }
.toast-error { background: var(--danger); color: var(--white); }
.toast-info { background: var(--teal); color: var(--white); }

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ─── Login Screen ───────────────────────────────────────────────────────── */
.login-screen {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; background: var(--bg-page);
}

.login-card {
    text-align: center; padding: 40px;
}

.login-card img { height: 60px; margin-bottom: 30px; }

.login-card h1 {
    color: var(--teal); font-size: 22px; font-weight: 900;
    letter-spacing: 3px; margin-bottom: 30px;
}

.login-btn {
    display: inline-block;
    background: var(--teal); color: var(--white);
    padding: 12px 32px; border-radius: 10px;
    font-size: 13px; font-weight: 700;
    text-decoration: none; transition: background 0.15s;
}
.login-btn:hover { background: #21b6ca; text-decoration: none; }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 40px;
    color: var(--muted); font-size: 14px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header { padding: 0 12px; gap: 8px; }
    .filter-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
    .modal { width: 98vw; }
    .form-grid { grid-template-columns: auto 1fr; }
}

/* ─── View-only mode ─────────────────────────────────────────────────────── */
.view-only input,
.view-only textarea,
.view-only select {
    opacity: 0.6; pointer-events: none;
    background: #04161a !important;
}
.view-only input[type="checkbox"] { pointer-events: none; }

/* ─── Scoring Criteria Tab ───────────────────────────────────────────────── */
.scoring-grid {
    padding: 20px 32px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px; overflow: auto;
    max-height: calc(100vh - 140px);
}

.scoring-card {
    background: rgba(232,245,247,0.05);
    border: 1px solid rgba(29,157,174,0.20);
    border-radius: 12px; padding: 14px;
}
.scoring-full { grid-column: 1 / -1; }

.scoring-card-title {
    font-size: 14px; font-weight: 600; color: var(--teal);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 9px; border-bottom: 1px solid rgba(29,157,174,0.18);
    padding-bottom: 7px;
}

.scoring-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 0; border-bottom: 1px solid rgba(29,157,174,0.06);
    font-size: 13px;
}
.scoring-row:last-child { border-bottom: none; }

.scoring-event { color: rgba(232,245,247,0.80); }
.scoring-pts { font-weight: 600; color: var(--teal); white-space: nowrap; }
.scoring-formula { color: rgba(232,245,247,0.55); font-size: 12px; font-style: italic; }
.scoring-sublabel {
    font-size: 12px; color: rgba(29,157,174,0.75);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px;
}

/* Pitch Checkpoints Table */
.pitch-table { width: 100%; border-collapse: collapse; }
.pitch-table thead tr {
    background: rgba(0,18,20,0.50);
    border-bottom: 1px solid rgba(29,157,174,0.25);
}
.pitch-table th {
    font-size: 12px; font-weight: 600;
    color: rgba(29,157,174,0.80); padding: 7px 10px; text-align: left;
}
.pitch-table tbody tr { border-bottom: 1px solid rgba(29,157,174,0.08); }
.pitch-table tbody tr:last-child { border-bottom: none; }
.pitch-table tbody tr:hover { background: rgba(29,157,174,0.05); }
.pitch-table td { font-size: 13px; padding: 9px 10px; vertical-align: middle; }

.pitch-badge {
    display: inline-block; background: rgba(29,157,174,0.18);
    color: var(--teal); font-size: 12px; font-weight: 700;
    padding: 2px 8px; border-radius: 4px;
}
.pitch-cond { color: rgba(232,245,247,0.80); }
.pitch-action {
    display: flex; align-items: center; gap: 7px;
    color: var(--light); font-weight: 500;
}
.pitch-icon-check {
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(29,157,174,0.25);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pitch-icon-li {
    width: 18px; height: 18px; border-radius: 3px;
    background: rgba(29,157,174,0.25);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
