/* ── Tandem Amore CS Portal — Brand Stylesheet ─────────────────────── */

:root {
    /* Teal (Primary) */
    --teal-50: #EDF8F9;
    --teal-100: #D4EFF2;
    --teal-200: #A9DFE6;
    --teal-300: #6EC8D5;
    --teal-400: #3BAFC0;
    --teal-500: #2997AA;
    --teal-600: #1F7A8C;
    --teal-700: #175E6D;
    --teal-800: #11424E;
    --teal-900: #0A2830;

    /* Sage (Secondary) */
    --sage-400: #52A98E;
    --sage-500: #3B9278;

    /* Sky (Accent) */
    --sky-400: #5AB8D4;

    /* Warm */
    --warm-50: #FBF8F6;
    --warm-100: #F3EDE8;
    --warm-200: #E8DDD5;

    /* Blush */
    --blush-100: #F7EEED;
    --blush-300: #E8C5C2;
    --blush-500: #C8847E;

    /* Semantic */
    --surface: #FAFCFC;
    --background: #F2F8F9;
    --text: #0F3540;
    --text-mid: #3A6170;
    --text-soft: #7A9EA8;
    --border: #C8DFE4;

    /* Fonts */
    --font-display: 'DM Serif Display', serif;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'DM Sans', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(15,53,64,0.06);
    --shadow-md: 0 4px 16px rgba(15,53,64,0.10);
    --shadow-lg: 0 12px 40px rgba(15,53,64,0.14);
    --shadow-teal: 0 8px 32px rgba(41,151,170,0.25);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3BAFC0 0%, #2E8EA0 50%, #1F7A8C 100%);
    --gradient-sidebar: linear-gradient(180deg, #11424E 0%, #1F7A8C 100%);
}

/* ── Base ────────────────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--teal-800);
}

a { color: var(--teal-500); }
a:hover { color: var(--teal-700); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-tda {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}
.btn-tda:hover {
    box-shadow: var(--shadow-teal);
    transform: translateY(-1px);
    color: #fff;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.table { font-size: 14px; }
.table thead th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--teal-700);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-hover tbody tr:hover { background: var(--teal-50); }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.cs-sidebar {
    background: var(--gradient-sidebar);
    min-height: 100vh;
    width: 220px;
    position: fixed;
}
.cs-sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.15s;
}
.cs-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.cs-sidebar .nav-link.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.cs-sidebar-logo { height: 40px; margin-bottom: 4px; }
.cs-sidebar-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    color: var(--teal-100);
    letter-spacing: 0.5px;
}

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge-priority-urgent { background: var(--blush-500); color: #fff; }
.badge-priority-high { background: var(--blush-300); color: var(--text); }
.badge-priority-medium { background: var(--teal-100); color: var(--text); }
.badge-priority-low { background: var(--warm-200); color: var(--text-mid); }

.badge-status-open { background: var(--blush-500); color: #fff; }
.badge-status-inprogress { background: var(--blush-300); color: var(--text); }
.badge-status-waitingoncustomer { background: var(--sky-400); color: #fff; }
.badge-status-waitingoncs { background: var(--sage-400); color: #fff; }
.badge-status-resolved { background: var(--sage-500); color: #fff; }
.badge-status-closed { background: var(--text-soft); color: #fff; }

/* ── Form Controls ────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--teal-400);
    box-shadow: 0 0 0 3px rgba(41,151,170,0.15);
}

/* ── Alerts ───────────────────────────────────────────────────────────── */
.alert-success {
    background: var(--teal-50);
    border-color: var(--teal-200);
    color: var(--teal-700);
}
.alert-danger {
    background: var(--blush-100);
    border-color: var(--blush-300);
    color: var(--blush-500);
}

/* ── Kanban Board ─────────────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.kanban-header {
    display: grid;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.kanban-agent-header {
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
}

.kanban-col-header {
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-col-count {
    background: var(--teal-100);
    color: var(--teal-700);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.kanban-row {
    display: grid;
    border-bottom: 1px solid var(--border);
}
.kanban-row:last-child { border-bottom: none; }

.kanban-agent-row { background: var(--surface); }

.kanban-agent-cell {
    padding: 12px 16px;
    font-weight: 500;
    font-size: 13px;
    color: var(--teal-800);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    min-height: 40px;
}
.kanban-agent-cell-empty {
    min-height: auto;
    padding: 0;
}

.kanban-agent-toggle { user-select: none; }
.kanban-toggle-arrow {
    font-size: 10px;
    display: inline-block;
    width: 14px;
    color: var(--text-soft);
}
.kanban-agent-count {
    font-weight: 400;
    color: var(--text-soft);
    font-size: 11px;
    margin-left: 4px;
}

.kanban-cell-collapsed {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kanban-collapsed-count {
    background: var(--teal-100);
    color: var(--teal-700);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 9999px;
}
.kanban-cell-header-spacer {
    min-height: auto;
    padding: 0;
    border-right: 1px solid var(--border);
}

.kanban-cell {
    padding: 8px;
    min-height: 80px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.15s;
}
.kanban-cell:last-child { border-right: none; }

.kanban-cell-hover {
    background: var(--teal-50);
    outline: 2px dashed var(--teal-400);
    outline-offset: -2px;
}

.kanban-empty {
    min-height: 40px;
}

/* ── Kanban Card ──────────────────────────────────────────────────────── */
.kanban-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}
.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.kanban-card-dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

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

.kanban-card-number {
    font-weight: 600;
    color: var(--teal-700);
    font-size: 11px;
}

.kanban-card-priority {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kanban-card-subject {
    color: var(--text);
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.kanban-card-meta {
    color: var(--text-soft);
    font-size: 10px;
}

/* ── Login Page ───────────────────────────────────────────────────────── */
.cs-login-card {
    width: 380px;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    background: #fff;
}
.cs-login-logo {
    height: 48px;
    margin-bottom: 12px;
}
.cs-login-title {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--teal-700);
    font-size: 20px;
}
.cs-login-btn {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-weight: 500;
    padding: 10px;
    box-shadow: var(--shadow-teal);
    transition: box-shadow 0.2s, transform 0.2s;
}
.cs-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(41,151,170,0.35);
    color: #fff;
}
