/* ═══════════════════════════════════════════════════
   21studio Demo Panel — Dark Theme
   ═══════════════════════════════════════════════════ */

:root {
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-card: #16161a;
    --bg-card-hover: #1c1c21;
    --bg-input: #0f0f12;

    --border: #27272a;
    --border-light: #1e1e22;
    --border-focus: #7c3aed;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #6d28d9);

    --green: #4ade80;
    --green-bg: #052e16;
    --green-border: #14532d;
    --yellow: #facc15;
    --yellow-bg: #422006;
    --yellow-border: #713f12;
    --red: #f87171;
    --red-bg: #450a0a;
    --red-border: #7f1d1d;

    --radius: 10px;
    --radius-lg: 14px;
    --transition: 0.2s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset & Base ──────────────────────────────── */

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

/* ─── Login Page ────────────────────────────────── */

.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 20px 60px rgba(0,0,0,0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    height: 40px;
    width: auto;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 24px;
}

/* ─── Header ────────────────────────────────────── */

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-logo {
    height: 26px;
    width: auto;
}

.accent { color: var(--accent); }

.header-divider {
    color: var(--text-muted);
    font-weight: 300;
}

.header-section {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── Main Content ──────────────────────────────── */

.main {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 32px 64px;
}

/* ─── Buttons ───────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-full { width: 100%; }

.btn-link {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: color var(--transition);
}
.btn-link:hover { color: var(--text-primary); }

.btn-delete {
    background: transparent;
    border: 1px solid var(--red-border);
    color: var(--red);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
}
.btn-delete:hover {
    background: var(--red-bg);
    border-color: var(--red);
}

.btn-copy {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition);
}
.btn-copy:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-copy.copied {
    color: var(--green);
    border-color: var(--green);
}

/* ─── Forms ─────────────────────────────────────── */

.form-container {
    max-width: 560px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-prefix-wrap {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-muted);
    font-size: 13px;
    font-family: monospace;
    white-space: nowrap;
}

.input-prefix-wrap input {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* ─── Alerts ────────────────────────────────────── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-top: 16px;
}

.alert-error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red);
}

.alert-warning {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
}

/* ─── Stats Grid ────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition);
}

.stat-card:hover {
    border-color: var(--text-muted);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-warning .stat-number {
    background: linear-gradient(135deg, var(--red), #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ─── Sections ──────────────────────────────────── */

.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* ─── Badges ────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-green  { background: var(--green-bg);  border: 1px solid var(--green-border);  color: var(--green); }
.badge-yellow { background: var(--yellow-bg); border: 1px solid var(--yellow-border); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    border: 1px solid var(--red-border);    color: var(--red); }
.badge-muted  { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-muted); }

/* ─── Table ─────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.table th {
    background: var(--bg-secondary);
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.row-expired td { opacity: 0.5; }

.sort-link {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.sort-link:hover { color: var(--text-primary); }

.cell-name { font-weight: 600; color: var(--text-primary); }
.cell-date { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cell-notes { color: var(--text-secondary); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.link-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-link {
    color: var(--accent);
    font-size: 12px;
    font-family: monospace;
}

.inline-form { display: inline; }

/* ─── Empty State ───────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }

.empty-state p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

/* ─── Success Box ───────────────────────────────── */

.success-box {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-lg);
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--green-bg);
    border: 2px solid var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 24px;
    font-weight: 700;
}

.success-box h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ─── Activity Log ──────────────────────────────── */

.activity-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-card-hover); }

.activity-icon { font-size: 16px; flex-shrink: 0; }
.activity-text { flex: 1; font-size: 13px; color: var(--text-secondary); }
.activity-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ─── Mobile Cards (hidden on desktop) ──────────── */

.cards-mobile {
    display: none;
}

.demo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}

.demo-card:hover { border-color: var(--text-muted); }

.card-expired { opacity: 0.5; }

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-name { font-weight: 600; font-size: 15px; }

.card-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.card-link a {
    font-size: 12px;
    font-family: monospace;
    color: var(--accent);
    word-break: break-all;
}

.card-notes {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.card-date {
    color: var(--text-muted);
    font-size: 12px;
}

/* ─── CRM Status Badges ─────────────────────────── */

.status-blue    { background: #0c1a3a; border: 1px solid #1e3a5f; color: #60a5fa; }
.status-violet  { background: #1a0a3a; border: 1px solid #3b1a6e; color: #a78bfa; }
.status-yellow  { background: var(--yellow-bg); border: 1px solid var(--yellow-border); color: var(--yellow); }
.status-cyan    { background: #0a2a2a; border: 1px solid #0e4a4a; color: #22d3ee; }
.status-green   { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.status-red     { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }
.status-gray    { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-muted); }

/* ─── Status Select ─────────────────────────────── */

.status-select {
    appearance: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 32px 8px 16px;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition);
}

.status-select:focus { border-color: var(--border-focus); }
.status-select.status-blue { border-color: #1e3a5f; color: #60a5fa; }
.status-select.status-violet { border-color: #3b1a6e; color: #a78bfa; }
.status-select.status-yellow { border-color: var(--yellow-border); color: var(--yellow); }
.status-select.status-cyan { border-color: #0e4a4a; color: #22d3ee; }
.status-select.status-green { border-color: var(--green-border); color: var(--green); }
.status-select.status-red { border-color: var(--red-border); color: var(--red); }
.status-select.status-gray { border-color: var(--border); color: var(--text-muted); }

/* ─── Filter Tabs ───────────────────────────────── */

.filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-tab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Follow-up Alert ───────────────────────────── */

.followup-alert {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    color: var(--yellow);
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
}

.followup-alert a {
    color: var(--text-primary);
    text-decoration: underline;
    font-weight: 600;
}

/* ─── Clickable Row ─────────────────────────────── */

.clickable-row { cursor: pointer; }
.cell-overdue { color: var(--red) !important; font-weight: 600; }

/* ─── Client Page ───────────────────────────────── */

.client-page { max-width: 1100px; }

.client-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.client-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.client-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-section-link {
    color: var(--text-muted);
    text-decoration: none;
}
.header-section-link:hover { color: var(--text-primary); }

.client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.client-col { display: flex; flex-direction: column; gap: 20px; }

/* ─── Detail Card ───────────────────────────────── */

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.detail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.detail-rows { display: flex; flex-direction: column; gap: 14px; }

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.detail-label {
    flex-shrink: 0;
    width: 130px;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 2px;
}

.detail-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    min-height: 24px;
}

.detail-value a { color: var(--accent); }
.detail-value a:hover { text-decoration: underline; }

/* ─── Inline Edit ───────────────────────────────── */

.editable {
    cursor: pointer;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: 6px;
    transition: background var(--transition);
}

.editable:hover { background: var(--bg-card-hover); }

.inline-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-focus);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.inline-date, .inline-select {
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}

.inline-date:focus, .inline-select:focus {
    border-color: var(--border-focus);
}

.inline-date.overdue {
    border-color: var(--red-border);
    color: var(--red);
}

/* ─── Quick Actions ─────────────────────────────── */

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-action:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

.btn-action-danger { color: var(--red); border-color: var(--red-border); }
.btn-action-danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.action-icon { font-size: 16px; }

/* ─── Timeline ──────────────────────────────────── */

.history-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.history-form textarea {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
}

.history-form textarea:focus { border-color: var(--border-focus); }

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.timeline-auto .timeline-dot {
    background: var(--text-muted);
}

.timeline-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.timeline-auto .timeline-text {
    color: var(--text-muted);
    font-style: italic;
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.timeline-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.timeline-new {
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Form Extras ───────────────────────────────── */

.form-divider {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin: 28px 0 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select:focus { border-color: var(--border-focus); }

/* ─── Demo Card Link (mobile) ───────────────────── */

.demo-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ─── Flag Badge ───────────────────────────────── */

.flag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #3b1a0a;
    border: 1px solid #92400e;
    color: #fb923c;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.flag-sm {
    padding: 2px 8px;
    font-size: 10px;
}

.flag-badge-inline {
    margin-top: 6px;
}

.flag-badge-header {
    vertical-align: middle;
    margin-left: 8px;
    font-size: 12px;
}

.btn-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-flag:hover {
    border-color: #92400e;
    color: #fb923c;
}

.btn-flag-active {
    background: #3b1a0a;
    border-color: #92400e;
    color: #fb923c;
}

/* ─── Todos Card ──────────────────────────────── */

.todos-card {
    position: relative;
}

.todos-card-flagged {
    border-color: #92400e;
    box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.1), 0 4px 16px rgba(251, 146, 60, 0.05);
}

.todos-card .detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-hidden {
    display: none !important;
}

/* Add todo form */
.todo-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.todo-add-form input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.todo-add-form input[type="text"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Todo list */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.todo-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: opacity 0.2s, background 0.2s;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Custom checkbox */
.todo-check {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.todo-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.todo-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-check input:checked + .todo-checkmark {
    background: #22c55e;
    border-color: #22c55e;
}

.todo-check input:checked + .todo-checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.todo-check:hover .todo-checkmark {
    border-color: #22c55e;
}

/* Todo text */
.todo-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.todo-done .todo-text {
    text-decoration: line-through;
    opacity: 0.5;
}

.todo-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Delete button */
.todo-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.todo-item:hover .todo-delete {
    opacity: 1;
}

.todo-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ─── All Demos List ───────────────────────────── */

.all-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.all-list-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.all-list-item:last-child { border-bottom: none; }
.all-list-item:hover { background: var(--bg-card-hover); }

.all-list-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.all-list-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.all-list-details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.all-list-url {
    font-family: monospace;
    color: var(--accent);
}

.all-list-dot {
    color: var(--border);
}

/* ─── Kanban Card Flagged ──────────────────────── */

.kanban-card-flagged {
    border-color: #92400e;
}

.kanban-card-flagged:hover {
    border-color: #fb923c;
    box-shadow: 0 4px 16px rgba(251, 146, 60, 0.1);
}

/* ─── Kanban Board ──────────────────────────────── */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kanban-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-header-blue   { background: #0c1a3a; color: #60a5fa; border: 1px solid #1e3a5f; }
.kanban-header-cyan   { background: #0a2a2a; color: #22d3ee; border: 1px solid #0e4a4a; }
.kanban-header-violet { background: #1a0a3a; color: #a78bfa; border: 1px solid #3b1a6e; }

.kanban-count {
    background: rgba(255,255,255,0.1);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.kanban-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.kanban-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.kanban-card-link {
    display: block;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.kanban-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.kanban-card-source {
    color: var(--text-secondary);
}

.kanban-card-followup {
    font-weight: 500;
}

.kanban-card-followup.overdue {
    color: var(--red);
    font-weight: 600;
}

.kanban-card-notes {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.kanban-actions-row {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.kanban-action {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.kanban-action:hover {
    transform: translateY(-1px);
}

.kanban-action:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.kanban-action-cyan:hover   { background: #0a2a2a; border-color: #0e4a4a; color: #22d3ee; }
.kanban-action-violet:hover { background: #1a0a3a; border-color: #3b1a6e; color: #a78bfa; }
.kanban-action-yellow:hover { background: var(--yellow-bg); border-color: var(--yellow-border); color: var(--yellow); }
.kanban-action-green:hover  { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.kanban-action-red:hover    { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }

.kanban-action-copy {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
    flex: 0 0 auto;
}

.kanban-action-copy:hover {
    border-color: var(--accent);
}

/* ─── Done Section ─────────────────────────────── */

.done-section { margin-top: 8px; }

.done-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 0;
    list-style: none;
}

.done-header::-webkit-details-marker { display: none; }

.done-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
}

.done-header::before {
    content: '▶';
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition);
}

details[open] > .done-header::before {
    transform: rotate(90deg);
}

.done-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}

.done-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition);
}

.done-item:hover {
    border-color: var(--text-muted);
}

.done-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.done-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── Responsive ────────────────────────────────── */

@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .kanban-column {
        min-height: auto;
    }
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .header { padding: 0 16px; }
    .main { padding: 20px 16px 48px; }

    .table-wrap { display: none; }
    .cards-mobile { display: block; }

    .login-box { padding: 36px 24px; }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card { padding: 16px; }
    .stat-number { font-size: 24px; }

    .header-section { display: none; }
    .header-divider { display: none; }
}
