/* Ringwise App Styles - matches landing page design tokens */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface-2: #181824;
    --border: #1e1e2e;
    --border-hover: #2a2a40;
    --text: #e8e8ed;
    --text-muted: #8888a0;
    --text-dim: #55556a;
    --accent: #22d67a;
    --accent-dim: rgba(34, 214, 122, 0.08);
    --accent-glow: rgba(34, 214, 122, 0.15);
    --accent-hover: #1bc46c;
    --warm: #f5c542;
    --danger: #f04444;
    --danger-dim: rgba(240, 68, 68, 0.1);
    --info: #4499ff;
    --info-dim: rgba(68, 153, 255, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

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

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.sidebar-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.sidebar-logo .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar-nav a:hover {
    background: var(--accent-dim);
    color: var(--text);
}
.sidebar-nav a.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 500;
}
.sidebar-nav .icon { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: auto;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}
.sidebar-footer a:hover { color: var(--text); background: var(--accent-dim); }

/* Main content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px 40px;
    max-width: 1200px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.page-header h1 { font-size: 1.8rem; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-header .badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(34, 214, 122, 0.15);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.stat-card .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-card .sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* Tables */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--accent-dim); }

/* Status badges */
.badge-status {
    display: inline-block;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: capitalize;
}
.badge-confirmed { background: var(--accent-dim); color: var(--accent); }
.badge-completed { background: var(--accent-dim); color: var(--accent); }
.badge-cancelled { background: var(--danger-dim); color: var(--danger); }
.badge-positive { background: var(--accent-dim); color: var(--accent); }
.badge-neutral { background: rgba(136, 136, 160, 0.1); color: var(--text-muted); }
.badge-negative { background: var(--danger-dim); color: var(--danger); }
.badge-urgent { background: rgba(245, 197, 66, 0.12); color: var(--warm); }
.badge-escalated { background: rgba(245, 197, 66, 0.12); color: var(--warm); }
.badge-booked_appointment { background: var(--accent-dim); color: var(--accent); }
.badge-answered_call { background: var(--info-dim); color: var(--info); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--surface); }
.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(240, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(240, 68, 68, 0.15); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { padding: 8px 10px; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}
.form-group .hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
select option { background: var(--surface); color: var(--text); }

/* Onboarding steps */
.onboard-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 60px 24px;
}
.onboard-header {
    text-align: center;
    margin-bottom: 48px;
}
.onboard-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}
.onboard-header p {
    color: var(--text-muted);
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}
.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all 0.3s;
}
.step-dot.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}
.step-dot.done {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}

.step-content { display: none; }
.step-content.active { display: block; }

.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    gap: 16px;
}

/* Service/FAQ input rows */
.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.input-row input, .input-row textarea {
    flex: 1;
}
.input-row .btn-remove {
    padding: 10px 12px;
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(240, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
}
.add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Call list items */
.call-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.call-item:last-child { border-bottom: none; }
.call-item:hover { background: var(--accent-dim); }
.call-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.call-avatar.positive { background: var(--accent-dim); color: var(--accent); }
.call-avatar.neutral { background: rgba(136, 136, 160, 0.1); color: var(--text-muted); }
.call-avatar.negative { background: var(--danger-dim); color: var(--danger); }
.call-avatar.urgent { background: rgba(245, 197, 66, 0.12); color: var(--warm); }
.call-info { flex: 1; min-width: 0; }
.call-name { font-weight: 500; font-size: 0.95rem; }
.call-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-meta {
    text-align: right;
    flex-shrink: 0;
}
.call-time { font-size: 0.8rem; color: var(--text-muted); }
.call-duration { font-size: 0.72rem; color: var(--text-dim); }

/* Appointment slots */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.slot-btn {
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.slot-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.slot-btn.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

/* Call detail modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}
.modal h2 { margin-bottom: 20px; font-size: 1.3rem; }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: 0.9rem;
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--danger); }

/* Simulated call widget */
.sim-call-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 480px;
}
.sim-call-widget h3 { margin-bottom: 16px; font-size: 1.1rem; }
.sim-messages {
    min-height: 200px;
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.sim-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 85%;
}
.sim-msg.caller {
    background: var(--info-dim);
    color: var(--text);
    margin-left: auto;
}
.sim-msg.ai {
    background: var(--accent-dim);
    color: var(--text);
}
.sim-msg .tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.sim-input {
    display: flex;
    gap: 10px;
}
.sim-input input { flex: 1; }

/* Loading */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}
@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px 20px; }
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 8px 0;
        z-index: 100;
        justify-content: space-around;
    }
    .mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-muted);
        font-size: 0.7rem;
        padding: 6px 12px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    .mobile-nav a.active { color: var(--accent); }
    .mobile-nav .icon { font-size: 1.3rem; }
    .main-content { padding-bottom: 80px; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.mobile-nav { display: none; }
