/* ================================================================
   FacturaSegura - Main Stylesheet
   Clean, warm, professional accounting SaaS design
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --surface-alt: #F1F5F9;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --text: #0F172A;
    --text-2: #475569;
    --text-3: #94A3B8;
    --accent: #2563EB;
    --accent-light: #EFF6FF;
    --accent-dark: #1D4ED8;
    --green: #16A34A;
    --green-light: #F0FDF4;
    --green-bg: #BBF7D0;
    --blue: #2563EB;
    --blue-light: #EFF6FF;
    --blue-bg: #BFDBFE;
    --red: #DC2626;
    --red-light: #FEF2F2;
    --red-bg: #FECACA;
    --yellow: #D97706;
    --yellow-light: #FFFBEB;
    --yellow-bg: #FDE68A;
    --purple: #7C3AED;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --transition: 0.15s ease;
}

/* ─── DARK MODE ─── */
[data-theme="dark"] {
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-hover: #334155;
    --surface-alt: #1E293B;
    --border: #334155;
    --border-light: #1E293B;
    --text: #F1F5F9;
    --text-2: #94A3B8;
    --text-3: #64748B;
    --accent: #3B82F6;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-dark: #2563EB;
    --green: #22C55E;
    --green-light: rgba(34, 197, 94, 0.12);
    --green-bg: rgba(34, 197, 94, 0.2);
    --blue: #3B82F6;
    --blue-light: rgba(59, 130, 246, 0.12);
    --blue-bg: rgba(59, 130, 246, 0.2);
    --red: #EF4444;
    --red-light: rgba(239, 68, 68, 0.12);
    --red-bg: rgba(239, 68, 68, 0.2);
    --yellow: #F59E0B;
    --yellow-light: rgba(245, 158, 11, 0.12);
    --yellow-bg: rgba(245, 158, 11, 0.2);
    --purple: #A78BFA;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}

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

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

/* ─── TOP NAV ─── */
.topnav {
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    flex-shrink: 0;
    z-index: 100;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-right: 8px;
}

.topnav-brand .logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}

.topnav-tabs {
    display: flex;
    gap: 2px;
    background: var(--surface-alt);
    padding: 3px;
    border-radius: var(--radius);
}

.topnav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: var(--font);
    transition: all var(--transition);
    white-space: nowrap;
}

.topnav-tab:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.03);
}

.topnav-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.topnav-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.topnav-spacer {
    flex: 1;
}

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

/* ─── STAT CARDS ─── */
.stats-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
}

.stat-card {
    flex: 1;
    min-width: 170px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 16px;
    position: relative;
    transition: border-color var(--transition);
}

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

.stat-card-icon {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 20px;
    opacity: 0.2;
}

.stat-card-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-card-sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
}

/* ─── TOOLBAR ─── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: 34px;
    width: 260px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box svg {
    width: 15px;
    height: 15px;
    color: var(--text-3);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    width: 100%;
    outline: none;
}

.filter-pills {
    display: flex;
    gap: 6px;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    user-select: none;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: var(--font);
}

.filter-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-pill.active {
    opacity: 1;
}

.filter-pill.inactive {
    opacity: 0.4;
    text-decoration: line-through;
}

.pill-overdue {
    background: var(--red-light);
    color: var(--red);
}

.pill-overdue .dot {
    background: var(--red);
}

.pill-due {
    background: var(--blue-light);
    color: var(--blue);
}

.pill-due .dot {
    background: var(--blue);
}

.pill-paid {
    background: var(--green-light);
    color: var(--green);
}

.pill-paid .dot {
    background: var(--green);
}

.pill-active {
    background: var(--yellow-light);
    color: var(--yellow);
}

.pill-active .dot {
    background: var(--yellow);
}

.toolbar-spacer {
    flex: 1;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--surface-hover);
    border-color: #d5d3ce;
}

.btn svg {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-green {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.btn-green:hover {
    background: #15803d;
}

.btn-ghost {
    border: none;
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-xs {
    padding: 3px 6px;
    font-size: 10px;
}

/* ─── BADGE ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-overdue {
    color: var(--red);
    background: var(--red-bg);
}

.badge-due {
    color: var(--blue);
    background: var(--blue-bg);
}

.badge-paid {
    color: var(--green);
    background: var(--green-bg);
}

.badge-active {
    color: var(--yellow);
    background: var(--yellow-bg);
}

/* ─── MAIN CONTENT ─── */
.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ─── TABLE VIEW ─── */
.table-container {
    flex: 1;
    overflow: auto;
    padding: 0;
}

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

.invoice-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.invoice-table th {
    background: var(--surface-alt);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-2);
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.invoice-table th:hover {
    background: #e9e7e2;
}

.invoice-table th .sort-arrow {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.3;
}

.invoice-table th.sorted .sort-arrow {
    opacity: 1;
    color: var(--accent);
}

.invoice-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.invoice-table tbody tr:hover {
    background: var(--surface-hover);
}

/* Group header rows */
.invoice-table .group-row td {
    background: var(--surface-alt);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-2);
    padding: 8px 16px;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
}

.invoice-table .group-row:hover td {
    background: #e9e7e2;
}

.partner-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.partner-cell-name {
    font-weight: 600;
    color: var(--text);
}

.partner-cell-email {
    font-size: 11px;
    color: var(--text-3);
}

.amount-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
}

.amount-overdue {
    color: var(--red);
}

.amount-due {
    color: var(--blue);
}

.amount-paid {
    color: var(--green);
}

.days-cell {
    font-weight: 600;
    font-size: 12px;
}

.days-overdue {
    color: var(--red);
}

.days-until {
    color: var(--blue);
}

.actions-cell {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* ─── NOTIFICATION CHANNELS ─── */
.notify-channels {
    display: flex;
    gap: 3px;
}

.notify-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    transition: all var(--transition);
    font-size: 12px;
}

.notify-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.notify-btn.sent {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green);
}

/* ─── TIMELINE VIEW ─── */
.timeline-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.timeline-sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.timeline-sidebar-header {
    height: 70px;
    padding: 12px 16px;
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-sidebar-header-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
}

.timeline-sidebar-rows {
    flex: 1;
    overflow-y: auto;
}

.timeline-sidebar-row {
    min-height: 60px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}

.timeline-sidebar-row:hover {
    background: var(--surface-hover);
}

.timeline-sidebar-row .name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-sidebar-row .meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.timeline-sidebar-row .tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tag-fast {
    background: #DCFCE7;
    color: #166534;
}

.tag-medium {
    background: #FEF3C7;
    color: #92400E;
}

.tag-slow {
    background: #FEE2E2;
    color: #991B1B;
}

.timeline-scroll-area {
    flex: 1;
    overflow: auto;
    position: relative;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.timeline-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 70px;
    background: var(--surface-alt);
    border-bottom: 2px solid var(--border);
    min-width: 2400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.timeline-months-row {
    height: 35px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.timeline-month-label {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    border-right: 1px solid var(--border);
}

.timeline-weeks-row {
    height: 35px;
    position: relative;
}

.timeline-week-label {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-3);
    font-weight: 600;
    border-right: 1px solid var(--border-light);
}

.timeline-body {
    position: relative;
    min-width: 2400px;
    flex: 1;
}

.timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    z-index: 15;
    pointer-events: none;
}

.timeline-today-label {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-month-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    z-index: 5;
    pointer-events: none;
}

.timeline-row {
    min-height: 60px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.timeline-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.01);
}

.timeline-bar {
    position: absolute;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.1s;
    font-weight: 500;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 12px;
}

.timeline-bar:hover {
    transform: scaleY(1.15);
    z-index: 12;
}

.timeline-bar.bar-paid {
    background: var(--green);
    color: #fff;
}

.timeline-bar.bar-overdue {
    background: var(--red);
    color: #fff;
}

.timeline-bar.bar-due {
    background: var(--blue);
    color: #fff;
}

.timeline-bar.bar-active {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    color: #92400E;
}

.timeline-bar.bar-draft {
    background: var(--surface-alt);
    border: 1px dashed var(--text-3);
    color: var(--text-3);
}

.timeline-payday {
    position: absolute;
    z-index: 14;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
}

.timeline-payday-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.payday-dot-paid {
    background: var(--green);
}

.payday-dot-overdue {
    background: var(--red);
}

.payday-dot-due {
    background: var(--blue);
}

.payday-dot-active {
    background: var(--yellow);
}

.timeline-connector {
    position: absolute;
    height: 1px;
    background: var(--text-3);
    opacity: 0.3;
    z-index: 5;
}

/* ─── ANALYTICS VIEW ─── */
.analytics-container {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
}

.chart-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chart-card-subtitle {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 16px;
}

.analytics-table-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}

.analytics-table-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.mini-table th {
    background: var(--surface-alt);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}

.mini-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.mini-table tr:hover {
    background: var(--surface-hover);
}

/* ─── MODAL ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    padding: 4px;
    font-size: 20px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

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

/* ─── FORMS ─── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ─── NOTIFICATION PANEL (inside modal) ─── */
.channel-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-alt);
    padding: 3px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.channel-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 6px;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    font-family: var(--font);
    background: transparent;
    color: var(--text-2);
    transition: all var(--transition);
}

.channel-tab:hover {
    color: var(--text);
}

.channel-tab.active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.channel-tab svg {
    width: 14px;
    height: 14px;
}

.recipient-box {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
}

/* ─── ALERTS ─── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-green {
    background: var(--green-light);
    border: 1px solid var(--green-bg);
    color: #166534;
}

.alert-red {
    background: var(--red-light);
    border: 1px solid var(--red-bg);
    color: #991B1B;
}

.alert-blue {
    background: var(--blue-light);
    border: 1px solid var(--blue-bg);
    color: #1E40AF;
}

.alert-yellow {
    background: var(--yellow-light);
    border: 1px solid var(--yellow-bg);
    color: #92400E;
}

/* ─── TOAST ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.toast-success {
    background: #166534;
}

.toast.toast-error {
    background: #991B1B;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
}

/* Hidden views */
.view-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.view-panel.active {
    display: flex;
}