/* Self-hosted fonts (latin subset) — Inter / Inter Tight variable woff2,
   served same-origin so no third-party font request (no SRI gap). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/static/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Inter Tight";
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url("/static/fonts/inter-tight-latin.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --white: #ffffff;
    --ghost-white: #edf5f4;
    --surface: #ffffff;
    --surface-soft: #f6faf9;
    --brand: #277f8e;
    --brand-accent: #165461;
    --brand-soft: #e3eff1;
    --headings: #18323b;
    --dark-slate-blue: #18323b;
    --slate-grey: #50646b;
    --muted: #7e9298;
    --border-mute: #dce8e7;
    --border-subtle: #cfe0df;
    --border-strong: #c2d5d4;
    --shadow-xs: 0 1px 2px rgba(24, 50, 59, 0.07);
    --shadow-sm: 0 14px 34px -18px rgba(24, 50, 59, 0.2);
    --shadow-md: 0 24px 58px -28px rgba(24, 50, 59, 0.26);
    --shadow-lg: 0 34px 76px -34px rgba(24, 50, 59, 0.32);
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-alt: "Inter Tight", var(--font-sans);
    --success: #1f9e63;
    --success-soft: #e6f8ef;
    --danger: #e44c5f;
    --danger-soft: rgba(228, 76, 95, 0.12);
    --warning: #f5a623;
    --warning-soft: rgba(245, 166, 35, 0.16);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --white: #17232a;
    --ghost-white: #0b0f18;
    --surface: #17232a;
    --surface-soft: #111b20;
    --brand: #62b5c3;
    --brand-accent: #8fd0da;
    --brand-soft: #172e35;
    --headings: #eef1f6;
    --dark-slate-blue: #eef1f6;
    --slate-grey: #adbac0;
    --muted: #74858d;
    --border-mute: #25333a;
    --border-subtle: #2c3c43;
    --border-strong: #35474f;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 16px 36px -16px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 28px 64px -26px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 40px 80px -28px rgba(0, 0, 0, 0.7);
    --success: #4fd99e;
    --success-soft: rgba(39, 194, 129, 0.16);
    --danger-soft: rgba(228, 76, 95, 0.18);
    --warning-soft: rgba(245, 166, 35, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 12% 12%, rgba(39, 127, 142, 0.12), transparent 34rem),
        linear-gradient(180deg, var(--ghost-white) 0%, var(--surface) 100%);
    color: var(--slate-grey);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.75rem;
    font-family: var(--font-alt);
    color: var(--headings);
    line-height: 1.25;
    letter-spacing: 0;
}

p {
    margin: 0 0 1rem;
    color: var(--slate-grey);
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
    color: var(--brand-accent);
}

button,
input,
textarea,
select {
    font-family: inherit;
}

input,
textarea,
select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background-color: var(--white);
    padding: 0.85rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(71, 146, 221, 0.15);
    background-color: var(--white);
}

.brand-button,
.nav-btn,
.submit-btn,
.account-toggle,
.download-btn,
.btn-view-details,
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.7rem;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-accent));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 14px 28px -12px rgba(39, 127, 142, 0.55);
}

.brand-button:hover,
.nav-btn:hover,
.submit-btn:hover,
.account-toggle:hover,
.download-btn:hover,
.btn-view-details:hover,
.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgba(39, 127, 142, 0.65);
}

.danger-button,
.btn-delete,
.btn-delete-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, #f06574, var(--danger));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 14px 28px rgba(228, 76, 95, 0.22);
}

.danger-button:hover,
.btn-delete:hover,
.btn-delete-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(228, 76, 95, 0.3);
}

.card,
.content-card,
.header-card,
.subscription-card,
.panel,
.welcome-card,
.data-card,
.detail-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-mute);
    box-shadow: var(--shadow-sm);
}

.status-badge,
.table-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.status-online,
.table-status-online {
    background: rgba(29, 191, 117, 0.12);
    color: var(--success);
    border: 1px solid rgba(29, 191, 117, 0.3);
}

.status-offline,
.table-status-offline {
    background: rgba(126, 130, 143, 0.12);
    color: var(--muted);
    border: 1px solid rgba(126, 130, 143, 0.3);
}

.success-message {
    background: var(--success-soft);
    border: 1px solid rgba(29, 191, 117, 0.24);
    color: var(--success);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
}

.error-message {
    background: var(--danger-soft);
    border: 1px solid rgba(228, 76, 95, 0.24);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
}

.table {
    width: 100%;
    border: 1px solid var(--border-mute);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
}

.table thead {
    background: rgba(71, 146, 221, 0.08);
    color: var(--dark-slate-blue);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.table th,
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-mute);
    text-align: left;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(71, 146, 221, 0.05);
}

.mono {
    font-family: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
}

.shadow-none {
    box-shadow: none !important;
}
