/* ===========================================================
   SQRM — Base theme
   Professional SaaS UI, blue theme, rounded cards, mobile-first.
   Light + dark mode via [data-theme] attribute on <html>.
   =========================================================== */

:root {
    --sqrm-blue-50: #eff6ff;
    --sqrm-blue-100: #dbeafe;
    --sqrm-blue-200: #bfdbfe;
    --sqrm-blue-500: #3b82f6;
    --sqrm-blue-600: #2563eb;
    --sqrm-blue-700: #1d4ed8;

    --bg: #f6f8fb;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);

    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;

    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0b1220;
    --bg-elevated: #121b2e;
    --text: #e6ebf5;
    --text-muted: #94a3b8;
    --border: #1f2b41;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--sqrm-blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* -------------------- Top nav -------------------- */
.sqrm-nav {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}
.sqrm-nav .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.sqrm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}
.sqrm-brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--sqrm-blue-600);
}
.sqrm-nav-links { display: flex; align-items: center; gap: 18px; }
.sqrm-nav-links a { color: var(--text-muted); font-weight: 500; font-size: 14px; }
.sqrm-nav-links a.active, .sqrm-nav-links a:hover { color: var(--sqrm-blue-600); text-decoration: none; }

/* -------------------- Buttons -------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sqrm-blue-600); color: #fff; }
.btn-primary:hover { background: var(--sqrm-blue-700); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--sqrm-blue-500); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* -------------------- Cards / forms -------------------- */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 22px;
    margin: 0 0 4px;
}
.auth-card p.subtitle {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 14px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.form-control:focus {
    outline: none;
    border-color: var(--sqrm-blue-500);
    box-shadow: 0 0 0 3px var(--sqrm-blue-100);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 16px;
}

/* -------------------- Alerts -------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
html[data-theme="dark"] .alert-success { background: #0d2318; color: #86efac; border-color: #14532d; }
html[data-theme="dark"] .alert-error { background: #2a1212; color: #fca5a5; border-color: #7f1d1d; }

/* -------------------- Badges / status pills -------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #dbeafe; color: #1e40af; }
.badge-preparing { background: #fde68a; color: #78350f; }
.badge-ready { background: #d1fae5; color: #065f46; }
.badge-served { background: #e0e7ff; color: #3730a3; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* -------------------- Footer -------------------- */
.sqrm-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* -------------------- Theme toggle -------------------- */
.theme-toggle {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

@media (max-width: 640px) {
    .sqrm-nav-links { gap: 12px; }
    .container { padding: 0 16px; }
}
