/* Sparkle & Detail — pink-and-blue 1970s retro theme
   Palette sourced from Sparkle_Detail_Brand_Kit.md. Interactive elements
   (buttons, sidebar) use deepened shades of the brand hues for text
   contrast — the kit's raw values are tuned for the logo/print, not
   white text on a button. */

:root {
    --bg-primary: #FAF3E8;       /* Cream Background */
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #1D6E93;       /* Sparkle Blue, deepened for white nav text */

    --color-pink: #F2A6C4;       /* Detail Pink (true brand value) — badges/light accents */
    --color-pink-dark: #D6588F;  /* deepened — default button fill */
    --color-pink-darker: #B93F73; /* button hover */
    --color-pink-light: #FBE7EF;

    --color-blue: #3FA9DC;       /* Sparkle Blue (true brand value) — badges/light accents */
    --color-blue-dark: #1D6E93;  /* deepened — default button fill, sidebar */
    --color-blue-darker: #145670; /* button hover */
    --color-blue-light: #E4F4FB;

    --color-yellow: #F5E6A8;     /* Star Yellow — small accents only, never a fill for large areas */
    --color-yellow-dark: #C9A227;

    --text-primary: #1A1A1A;     /* Ink Black */
    --text-secondary: #6E645D;
    --text-on-dark: #FAF3E8;

    --border-color: #F0DCC8;

    --radius: 14px;
    --shadow-soft: 0 2px 10px rgba(26, 26, 26, 0.08);

    --font-display: 'Titan One', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
}

h1, h2, h3, .brand-name, .page-title {
    font-family: var(--font-display);
}

a { color: var(--color-blue-dark); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    font-family: var(--font-body);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-pink-dark); color: #fff; }
.btn-primary:hover { background: var(--color-pink-darker); }
.btn-secondary { background: var(--color-blue-dark); color: #fff; }
.btn-secondary:hover { background: var(--color-blue-darker); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-danger { background: #fff; color: #C0392B; border-color: #F1B4AC; }

/* --- Cards / tables --- */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.stat-card { text-align: left; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--color-blue-dark); }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--color-pink-light);
}
table.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
table.data-table tr:hover td { background: var(--color-pink-light); }

.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-pink { background: var(--color-pink-light); color: var(--color-pink-dark); }
.badge-blue { background: var(--color-blue-light); color: var(--color-blue-dark); }
.badge-yellow { background: #FBF4D9; color: var(--color-yellow-dark); }
.badge-gray { background: #EEE; color: #666; }

/* --- Forms --- */
label { display: block; font-weight: 700; margin-bottom: 0.3rem; font-size: 0.9rem; }
input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text-primary);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-blue);
}
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* --- Layout --- */
.sidebar {
    width: 240px;
    /* height, not min-height: this is position:fixed, so it must be
       capped to the viewport for .sidebar-nav's flex:1 + overflow-y:auto
       below to actually activate. min-height let a long nav list grow
       the whole sidebar taller than the screen with no way to scroll to
       the overflow — 100dvh (where supported) accounts for mobile
       browser chrome shrinking the real usable height below 100vh. */
    height: 100vh;
    height: 100dvh;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.15s ease;
}
.sidebar.collapsed { width: 76px; }
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; padding: 1.2rem; }
.brand-icon { color: var(--color-pink); }
.sidebar .brand-name { font-size: 1.1rem; color: #fff; }
.brand-tagline { font-size: 0.7rem; color: rgba(255,255,255,0.7); }

/* Brand kit: "use on white/cream backgrounds for clean contrast" — the
   sidebar is dark blue, so the logo sits on a small white badge instead
   of directly on the background. */
.brand-logo-badge {
    background: #fff;
    border-radius: 10px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.brand-logo-img { display: block; height: 34px; width: auto; }
.login-logo-img { height: 92px; width: auto; margin: 0 auto 0.6rem; }
.public-logo-img { height: 52px; width: auto; }

.sidebar-nav { flex: 1; padding: 0.5rem 0.7rem; overflow-y: auto; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.1); }
.sidebar-link.active { background: var(--color-pink-dark); color: #fff; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.15); margin: 0.8rem 0.3rem; }
.sidebar-section-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.5); padding: 0.4rem 0.9rem; margin-bottom: 0.1rem; }
.sidebar-section { margin-bottom: 1.1rem; }
.sidebar-footer { padding: 0.7rem; border-top: 1px solid rgba(255,255,255,0.15); }

.main-content { margin-left: 240px; padding: 2rem 2.5rem; transition: margin-left 0.15s ease; }
.main-content.sidebar-collapsed { margin-left: 76px; }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.8rem; flex-wrap: wrap; gap: 1rem; }
.page-title { font-size: 1.6rem; margin: 0; color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); margin: 0.2rem 0 0; }

.sidebar-mobile-header { display: none; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem; background: var(--bg-sidebar); color: #fff; }

/* Two-column "sidebar card + main content" detail-page layout, reused
   across Tasks, Candidate/Cleaner/Client detail. Fixed-width left column
   collapses to a single column below 900px — without this, the fixed
   px track never shrinks and forces the whole page wider than the
   viewport, breaking scroll on phones (and narrow desktop windows). */
.tasks-layout-grid, .candidate-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }
.cleaner-profile-grid, .client-detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); z-index: 40; }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-mobile-header { display: flex; }
    .main-content { margin-left: 0; padding: 1.2rem; }
    .form-row { grid-template-columns: 1fr; }
    .tasks-layout-grid, .candidate-detail-grid, .cleaner-profile-grid, .client-detail-grid { grid-template-columns: 1fr; }
}

/* --- Login page --- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-pink) 100%);
    padding: 1.5rem;
}
.login-card { width: 100%; max-width: 380px; }
.login-card .brand-icon { color: var(--color-pink); }

/* --- Toasts --- */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.8rem 1.2rem; border-radius: 10px; color: #fff; font-weight: 600; box-shadow: var(--shadow-soft); }
.toast-success { background: var(--color-blue-dark); }
.toast-error { background: #C0392B; }
.toast-warning { background: #E1428A; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.empty-state .btn { margin-top: 1rem; }

/* --- Pipeline (Kanban) --- */
.pipeline-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    align-items: flex-start;
}
.pipeline-column {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    width: 260px;
    flex-shrink: 0;
    min-height: 200px;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.pipeline-column.drag-over { background: var(--color-blue-light); border-color: var(--color-blue); }
.pipeline-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}
.pipeline-column-body { padding: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; min-height: 60px; }
.pipeline-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    cursor: grab;
}
.pipeline-card:active { cursor: grabbing; }
.pipeline-card-client { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.2rem; }
.pipeline-card-meta { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.15rem; }
.pipeline-card-link { display: inline-block; margin-top: 0.4rem; font-size: 0.78rem; font-weight: 700; color: var(--color-blue-dark); }
.pipeline-empty { font-size: 0.8rem; color: var(--text-secondary); text-align: center; padding: 1rem 0; }

/* --- VA Training page --- */
.va-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}
.va-checklist-item:last-child { border-bottom: none; }
.va-checklist-item input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.15rem; cursor: pointer; }
.va-checklist-item label { font-weight: 400; margin: 0; cursor: pointer; }
.va-checklist-item.checked label { text-decoration: line-through; color: var(--text-secondary); }
.va-task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.va-task-card { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 10px; padding: 0.9rem 1rem; }
.va-task-card h4 { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: 0.95rem; }
.va-task-card p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.va-voice-list { margin: 0.4rem 0 0.8rem; padding-left: 1.3rem; font-size: 0.9rem; }
.va-voice-list li { margin-bottom: 0.3rem; }

[x-cloak] { display: none !important; }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-decoration: underline;
    cursor: pointer;
}
