/* ── Dialer Sol Vacation — base styles ────────────────────────────────
   Iron rule 8 (UX): RTL Hebrew first, mobile-first, glass-morphism brand.
   Iron rule 4 (security): no inline styles in templates → nginx CSP can
   drop 'unsafe-inline' from style-src once nonce-based CSP is in place
   (planned for next batch alongside HTMX vendoring).
─────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans Hebrew",
                 "Heebo", system-ui, sans-serif;
    background: radial-gradient(ellipse at top right, #312e81 0%, #1e1b4b 40%, #0f172a 100%);
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Card (glass-morphism) ─────────────────────────────────────────── */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 3rem 2.5rem;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ── Logo + tagline ────────────────────────────────────────────────── */
.logo {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: #cbd5e1;
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* ── Status pill ───────────────────────────────────────────────────── */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #86efac;
    margin-bottom: 2rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

/* ── Action buttons ────────────────────────────────────────────────── */
.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ── Footer meta ──────────────────────────────────────────────────── */
.meta {
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 0.02em;
}

.meta span { margin: 0 0.5rem; }

/* ── Login page (placeholder until Phone OTP lands) ────────────────── */
.login-note {
    color: #cbd5e1;
    margin: 1rem 0;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.back-link {
    display: inline-block;
    margin-top: 1.25rem;
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover { text-decoration: underline; }

/* ── Auth forms (login + OTP) ───────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
    margin-bottom: 1rem;
}

.auth-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.auth-help {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: -0.25rem;
}

.auth-input {
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.auth-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.auth-input-code {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.auth-info {
    color: #cbd5e1;
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 1rem 0;
    padding: 0.875rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.auth-info strong {
    color: #f1f5f9;
    font-weight: 600;
}

.auth-error {
    padding: 0.625rem 0.875rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.auth-btn {
    margin-top: 0.75rem;
}

.auth-secondary {
    margin-top: 0.5rem;
}

.link-button {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem;
    text-decoration: none;
}

.link-button:hover { text-decoration: underline; }

/* ── Dashboard (placeholder until calls list lands) ──────────────────── */
.dashboard-body {
    display: block;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #0f172a;
}

.topbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.875rem 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-tenant {
    color: #94a3b8;
    font-size: 0.875rem;
    flex: 1;
}

.topbar-logout {
    margin: 0;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.dashboard-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: #cbd5e1;
}

.placeholder-meta {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

/* ── Filter bar (calls list page) ────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.filter-pill {
    padding: 0.5rem 1.125rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.filter-pill.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.filter-spacer { flex: 1; min-width: 0.5rem; }

.filter-search {
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 0.875rem;
    font-family: inherit;
    min-width: 200px;
    transition: border-color 0.15s ease;
}

.filter-search:focus {
    outline: none;
    border-color: #3b82f6;
}

/* ── Calls list / table ──────────────────────────────────────────────── */
.calls-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}

.empty-icon {
    display: block;
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.calls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.calls-table thead {
    background: rgba(15, 23, 42, 0.6);
}

.calls-table th {
    text-align: right;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calls-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.calls-row:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.calls-row.is-blacklisted td {
    opacity: 0.5;
    text-decoration: line-through;
}

.col-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.col-time-date {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.col-phone {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.col-duration {
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
}

.status-pill {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-answered {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-missed {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ai-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

.ai-hot {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.ai-warm {
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
}

.ai-cold {
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

.ai-note {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

.calls-meta {
    padding: 0.625rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.calls-error {
    text-align: center;
    padding: 2rem 1.5rem;
    color: #fca5a5;
}

.calls-error-detail {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .calls-table { font-size: 0.8125rem; }
    .calls-table th,
    .calls-table td { padding: 0.625rem 0.5rem; }
    .col-line { display: none; }
}
