/* humanTTS Customer Dashboard — dark theme matching record app */

:root {
    --bg: #0f0f1a;
    --surface: #1a1a2e;
    --surface2: #232340;
    --text: #e0e0e8;
    --text-muted: #888899;
    --accent: #f58220;
    --blue: #3a7dd4;
    --green: #2ecc71;
    --red: #e74c3c;
    --border: #2a2a42;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* --- Layout --- */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: baseline; gap: 10px; }
.header-left h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.header-left .accent { color: var(--accent); }
.header-left .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* --- Cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Forms --- */

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.form-group input:focus {
    border-color: var(--blue);
}

/* --- Buttons --- */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-small { padding: 8px 16px; font-size: 13px; }
.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
}
.btn-logout:hover { color: var(--text); }

/* --- API Key display --- */

.api-key-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 14px;
    word-break: break-all;
}
.api-key-box .key-text { flex: 1; }
.api-key-box .copy-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}
.api-key-box .copy-btn:hover { color: var(--text); }

/* --- Stats row --- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat {
    background: var(--surface2);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.stat .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}
.stat .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Tables --- */

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
td { color: var(--text); }

/* --- Status badges --- */

.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-completed { background: rgba(46, 204, 113, 0.15); color: var(--green); }
.status-queued, .status-notified, .status-recording { background: rgba(58, 125, 212, 0.15); color: var(--blue); }
.status-rejected, .status-expired { background: rgba(231, 76, 60, 0.15); color: var(--red); }

/* --- Payment method --- */

.payment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface2);
    border-radius: var(--radius);
}
.payment-card .brand { font-weight: 600; text-transform: capitalize; }
.payment-card .last4 { font-family: monospace; }
.payment-card .expiry { color: var(--text-muted); font-size: 13px; }

/* --- Alerts --- */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(46, 204, 113, 0.12); color: var(--green); border: 1px solid rgba(46, 204, 113, 0.3); }
.alert-error { background: rgba(231, 76, 60, 0.12); color: var(--red); border: 1px solid rgba(231, 76, 60, 0.3); }
.alert-warning { background: rgba(245, 130, 32, 0.12); color: var(--accent); border: 1px solid rgba(245, 130, 32, 0.3); }

/* --- Views --- */

.view { display: none; }
.view.active { display: block; }

/* --- Center form for login/setup --- */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 73px);
}
.auth-form {
    width: 100%;
    max-width: 400px;
    padding: 0 24px;
}
.auth-form h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
}
.auth-form .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}
