/* ============================================================
   EMAIL SERVICE PLATFORM — Metro Design System
   Palette: Sky Blue #39a8ea · Navy #122c5c · Ash #ecf1f4
   ============================================================ */

/* -- Custom Properties ---------------------------------------- */
:root {
    --primary: #39a8ea;
    --primary-dark: #2292d4;
    --secondary: #122c5c;
    --secondary-lt: #1a3d7a;
    --accent: #ecf1f4;
    --accent-md: #dde8ef;
    --surface: #ffffff;
    --surface-soft: #f7fafc;
    --ink: #162232;
    --ink-soft: #2d3d50;
    --muted: #5c6b7b;
    --line: #d6e0e9;
    --danger: #c0392b;
    --danger-lt: #fbeae9;
    --success: #27ae60;
    --success-lt: #e8f7ef;
    --warning: #d68910;
    --warning-lt: #fef9e7;
    --info-lt: #eaf5fd;

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --font: "Barlow", "Trebuchet MS", system-ui, sans-serif;
    --mono: "Courier New", Courier, monospace;
}

/* -- Reset & Base -------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--accent);
    min-height: 100vh;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    display: block;
    max-width: 100%;
}

/* -- Typography ---------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font);
    color: var(--secondary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.5rem, 2.2vw, 2.1rem);
}

h2 {
    font-size: clamp(1.18rem, 1.5vw, 1.5rem);
}

h3 {
    font-size: 1.05rem;
}

h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
}

p {
    margin-bottom: 0;
}

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--accent-md);
    color: var(--secondary);
    padding: 0.12em 0.38em;
    border: 1px solid var(--line);
}

/* -- Layout -------------------------------------------------- */
.container {
    width: min(1160px, 94%);
    margin: 0 auto;
}

/* -- Topbar -------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--secondary);
    border-bottom: 3px solid var(--primary);
    height: var(--topbar-h);
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
    color: var(--primary);
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
}

.brand-logo {
    background: transparent;
    width: auto;
    height: auto;
    padding: 0;
}

.brand-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.brand-text strong {
    display: block;
    line-height: 1;
}

.brand-text span {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topbar-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    letter-spacing: 0.02em;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-decoration: none;
}

.topbar-nav a:hover {
    color: #fff;
    border-bottom-color: var(--primary);
}

/* -- Buttons ------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.6rem 1.1rem;
    min-height: 38px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary,
.btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover,
.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-lt);
    border-color: var(--secondary-lt);
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: #fff;
    text-decoration: none;
}

.btn-outline-light {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
    text-decoration: none;
}

.btn-sm {
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
    min-height: 30px;
}

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 0.98rem;
    min-height: 46px;
}

.btn i {
    font-size: 0.9em;
}

/* -- Alerts -------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
    border-left: 4px solid;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert i {
    margin-top: 0.1em;
    flex-shrink: 0;
}

.alert.success {
    background: var(--success-lt);
    border-color: var(--success);
    color: #1d7a47;
}

.alert.error {
    background: var(--danger-lt);
    border-color: var(--danger);
    color: #922b21;
}

.alert.warning {
    background: var(--warning-lt);
    border-color: var(--warning);
    color: #7d6608;
}

.alert.info {
    background: var(--info-lt);
    border-color: var(--primary);
    color: #1a6fa0;
}

/* -- Badges -------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.22rem 0.55rem;
    line-height: 1;
}

.badge-success {
    background: var(--success-lt);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-lt);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-lt);
    color: var(--warning);
}

.badge-primary {
    background: var(--info-lt);
    color: var(--primary-dark);
}

.badge-muted {
    background: var(--accent-md);
    color: var(--muted);
}

/* Method badge for API docs */
.method-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.22rem 0.55rem;
    line-height: 1;
}

.method-post {
    background: var(--secondary);
    color: #fff;
}

.method-get {
    background: var(--success);
    color: #fff;
}

/* -- Cards & Panels ------------------------------------------ */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.panel-soft {
    background: var(--surface-soft);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
}

.panel-accent {
    border-left: 4px solid var(--primary);
}

/* -- Stat Cards ---------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--primary);
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.stat-card-icon {
    width: 56px;
    min-height: 90px;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.stat-card-icon.ic-primary {
    background: var(--primary);
}

.stat-card-icon.ic-success {
    background: var(--success);
}

.stat-card-icon.ic-danger {
    background: var(--danger);
}

.stat-card-icon.ic-warning {
    background: var(--warning);
}

.stat-card-icon.ic-secondary {
    background: var(--secondary);
}

.stat-card-body {
    padding: 0.9rem 1rem;
    flex: 1;
}

.stat-label {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1;
}

.stat-meta {
    font-size: 0.77rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

/* -- Tables -------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
}

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

.table th {
    background: var(--surface-soft);
    border-bottom: 2px solid var(--line);
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    white-space: nowrap;
}

.table td {
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    color: var(--ink-soft);
}

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

.table tbody tr:hover td {
    background: var(--surface-soft);
}

.table .text-muted {
    color: var(--muted);
    font-size: 0.8rem;
}

.table .mono {
    font-family: var(--mono);
    font-size: 0.82rem;
}

/* -- Forms --------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-grid .span-2 {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}

.form-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--ink-soft);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

.form-label i {
    color: var(--muted);
    font-size: 0.85em;
}

label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-align: left;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    padding: 0.6rem 0.8rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    line-height: 1.4;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(57, 168, 234, 0.18);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235c6b7b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
}

.input-hint {
    font-size: 0.77rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* Input with icon */
.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.input-wrap input {
    padding-left: 2.2rem;
}

/* -- Code Blocks --------------------------------------------- */
.code-block {
    background: #0d1f35;
    color: #a8d4f8;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.65;
    padding: 1.2rem 1.4rem;
    overflow-x: auto;
    white-space: pre;
    border: 1px solid #1e3a5c;
    position: relative;
}

.code-block .kw {
    color: #79c0ff;
}

.code-block .str {
    color: #a5d6ff;
}

.code-block .num {
    color: #f0c060;
}

.code-block .cm {
    color: #6a8ca8;
    font-style: italic;
}

.code-header {
    background: #0a1829;
    border: 1px solid #1e3a5c;
    border-bottom: 0;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-header span {
    font-size: 0.75rem;
    font-family: var(--mono);
    color: #5a8cac;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-header .lang-tag {
    font-size: 0.7rem;
    background: #1e3a5c;
    color: #79c0ff;
    padding: 0.15rem 0.4rem;
    margin-left: auto;
}

/* -- Dashboard Layout ---------------------------------------- */
.dashboard-wrap {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--secondary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 3px solid var(--primary);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-brand .sb-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

.sidebar-brand .sb-info {
    flex: 1;
    min-width: 0;
}

.sidebar-brand .sb-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand .sb-user {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-section {
    padding: 0.6rem 1rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.sidebar-link i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-decoration: none;
    border-left-color: rgba(255, 255, 255, 0.2);
}

.sidebar-link:hover i {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-link.active {
    background: rgba(57, 168, 234, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Admin sidebar variant */
.sidebar.admin-sidebar {
    background: #0d2040;
}

.sidebar.admin-sidebar .sidebar-section {
    color: rgba(255, 255, 255, 0.3);
}

/* Dashboard main area */
.dash-main {
    flex: 1;
    min-width: 0;
    padding: 1.6rem 1.8rem;
    background: var(--accent);
}

.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.dash-header h1 {
    margin: 0;
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
}

.dash-header .subtitle {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 0.2rem;
}

/* -- Landing Page / Public ----------------------------------- */
.main-content {
    padding: 2rem 0 4rem;
}

/* Hero */
.hero-block {
    background: var(--secondary);
    color: #fff;
    padding: 4rem 0 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.hero-block::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.hero-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-eyebrow::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--primary);
}

.hero-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1.1rem;
    max-width: 780px;
}

.hero-lead {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 640px;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Feature grid */
.features-section {
    padding: 3rem 0;
}

.features-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.features-header h2 {
    margin-bottom: 0.5rem;
}

.features-header p {
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.feature-card {
    background: var(--surface);
    padding: 1.6rem;
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 42px;
    height: 42px;
    background: var(--info-lt);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Highlight strip */
.highlight-strip {
    background: var(--primary);
    padding: 0.9rem 0;
    text-align: center;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* AI Content section */
.ai-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    padding: 2rem;
    margin: 1rem 0;
}

.ai-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-section p {
    color: var(--ink-soft);
    line-height: 1.7;
    font-size: 0.97rem;
}

/* -- Auth Pages ---------------------------------------------- */
.auth-page {
    min-height: calc(100vh - var(--topbar-h));
    display: flex;
    align-items: stretch;
}

.auth-side {
    background: var(--secondary);
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.5rem;
    border-right: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.auth-side::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(57, 168, 234, 0.06);
    bottom: -80px;
    right: -80px;
}

.auth-side-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.auth-side-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    line-height: 1.65;
}

.auth-bullet {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 1.2rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth-bullet i {
    color: var(--primary);
    margin-top: 0.1em;
    flex-shrink: 0;
}

.auth-form-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--accent);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 2.2rem;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
}

.auth-card .auth-sub {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

.auth-form .form-group+.form-group {
    margin-top: 0.9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.4rem 0;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.oauth-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.oauth-row .btn {
    flex: 1;
    min-width: 140px;
}

.auth-footer {
    margin-top: 1.4rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.auth-footer a {
    color: var(--primary-dark);
    font-weight: 600;
}

/* -- API Key Display ----------------------------------------- */
.key-display {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--line);
    overflow: hidden;
}

.key-display code {
    flex: 1;
    padding: 0.65rem 0.9rem;
    background: var(--surface-soft);
    border: 0;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.key-display .copy-btn {
    padding: 0 1rem;
    background: var(--secondary);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 0.8rem;
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font);
    font-weight: 600;
    transition: background 0.15s;
    flex-shrink: 0;
}

.key-display .copy-btn:hover {
    background: var(--secondary-lt);
}

.key-notice {
    background: var(--warning-lt);
    border: 1px solid #f0d080;
    border-left: 4px solid var(--warning);
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #6b5000;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-top: 0.9rem;
}

.key-notice i {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.1em;
}

/* -- Payment Cards ------------------------------------------- */
.gateway-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gateway-card {
    border: 2px solid var(--line);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    background: var(--surface);
}

.gateway-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Paystack selected: teal accent */
#card-paystack.selected {
    border-color: #0ba4db;
    background: #0ba4db0a;
    box-shadow: 0 2px 16px #0ba4db18;
}

/* Squad selected: orange accent */
#card-squad.selected {
    border-color: #f76300;
    background: #f763000a;
    box-shadow: 0 2px 16px #f7630018;
}

.gateway-card .check-mark {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 1;
}

#card-paystack.selected .check-mark {
    opacity: 1;
    background: #0ba4db;
}

#card-squad.selected .check-mark {
    opacity: 1;
    background: #f76300;
}

.gateway-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.gateway-card p {
    font-size: 0.82rem;
    color: var(--muted);
}

/* -- Endpoint Cards (API Docs) ------------------------------- */
.endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 1.2rem;
}

.endpoint-card {
    background: var(--surface);
    padding: 1.4rem;
}

.endpoint-path {
    font-family: var(--mono);
    font-size: 0.88rem;
    color: var(--secondary);
    font-weight: 600;
    margin: 0.5rem 0 0.4rem;
}

.endpoint-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.endpoint-card .param-list {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.endpoint-card .param-list code {
    margin-right: 0.25rem;
}

/* -- Health Metrics ------------------------------------------ */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.health-item {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.health-item i {
    font-size: 1.3rem;
    color: var(--primary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.health-item-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.health-item-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
}

/* -- API Console --------------------------------------------- */
.api-console {
    background: var(--surface);
    border: 1px solid var(--line);
    margin-top: 1.2rem;
}

.api-console-header {
    background: var(--secondary);
    color: #fff;
    padding: 0.85rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.api-console-header i {
    color: var(--primary);
}

.api-console-body {
    padding: 1.4rem;
}

/* -- Inline & Utility Classes -------------------------------- */
.inline-form {
    display: inline;
    margin: 0;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.ai-center {
    align-items: center;
}

.jc-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.text-muted {
    color: var(--muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-primary {
    color: var(--primary-dark);
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.fs-sm {
    font-size: 0.82rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.w-full {
    width: 100%;
}

.divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.2rem 0;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
    display: block;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Copy feedback */
.copy-feedback {
    font-size: 0.75rem;
    color: var(--success);
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.copy-feedback.show {
    opacity: 1;
}

/* -- Responsive ---------------------------------------------- */
/* Tablet portrait and below (≤960px): collapse sidebar to slide-in drawer */
@media (max-width: 960px) {

    /* public / auth pages */
    .auth-side {
        display: none;
    }

    .auth-form-area {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    /* dashboard: convert sidebar to drawer (display overrides are at end of file) */
    .dashboard-wrap {
        flex-direction: column;
        padding-top: 56px;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        max-width: 88vw !important;
        height: 100% !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-bottom: 0 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 901;
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-brand {
        padding: 1rem 1.2rem !important;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .sidebar-nav {
        display: block !important;
        flex: 1;
        padding: 0.6rem 0 !important;
        overflow-y: auto;
    }

    .sidebar-section {
        display: block !important;
    }

    .sidebar-link {
        padding: 0.8rem 1.3rem !important;
        border-left: 3px solid transparent !important;
        border-bottom: 0 !important;
        font-size: 0.9rem !important;
    }

    .sidebar-link.active {
        border-left-color: var(--primary) !important;
        border-bottom-color: transparent !important;
    }

    .sidebar-footer {
        padding: 1rem 1.2rem !important;
        border-left: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        flex-shrink: 0;
    }

    .dash-main {
        width: 100%;
        padding: 1.2rem !important;
    }
}

@media (max-width: 640px) {
    :root {
        --topbar-h: 56px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2 {
        grid-column: 1;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .endpoint-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Dashboard Grid (legacy support) ------------------------- */
.dashboard-grid {
    display: flex;
    min-height: 100vh;
}

.dashboard-main {
    flex: 1;
    padding: 1.6rem 1.8rem;
    background: var(--accent);
    min-width: 0;
}

/* -- Hamburger / Mobile Nav ---------------------------------- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0 9px;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.hamburger:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.hamburger span {
    display: block;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
}

.hamburger span:nth-child(3) {
    width: 70%;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    width: 100%;
}

.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.25s;
}

.mobile-nav-backdrop.open {
    display: block;
    opacity: 1;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 88vw;
    height: 100%;
    background: var(--secondary);
    z-index: 901;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.3);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.mobile-nav-logo img {
    height: 28px;
    width: auto;
}

.mobile-nav-logo-text {
    font-size: 0.87rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.mobile-nav-logo-text small {
    display: block;
    font-size: 0.67rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.03em;
}

.mobile-nav-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.65);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.mobile-nav-links {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0;
}

.mobile-nav-links a,
.mobile-nav-links .mob-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    width: 100%;
    background: none;
    font-family: var(--font);
    cursor: pointer;
    text-align: left;
}

.mobile-nav-links a:hover,
.mobile-nav-links .mob-nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--primary);
    text-decoration: none;
}

.mobile-nav-links a i,
.mobile-nav-links .mob-nav-btn i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.mobile-nav-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0.4rem 1.4rem;
}

@media (max-width: 960px) {
    .hamburger {
        display: flex;
    }

    .topbar-nav {
        display: none;
    }
}

/* -- Dashboard Mobile Topbar -------------------------------- */
.dash-mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--secondary);
    border-bottom: 3px solid var(--primary);
    z-index: 800;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 0.75rem;
}

.dash-mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}

.dash-mobile-brand img {
    height: 28px;
    width: auto;
    flex-shrink: 0;
}

.dash-mobile-brand-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.2;
    min-width: 0;
}

.dash-mobile-brand-text small {
    display: block;
    font-size: 0.67rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    padding: 0 9px;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.dash-hamburger:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.dash-hamburger span {
    display: block;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
}

.dash-hamburger span:nth-child(3) {
    width: 70%;
}

.dash-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.dash-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.dash-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    width: 100%;
}

.dash-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 850;
    opacity: 0;
    transition: opacity 0.25s;
}

.dash-sidebar-backdrop.open {
    display: block;
    opacity: 1;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Must appear AFTER element definitions so cascade order wins */
@media (max-width: 960px) {
    .dash-mobile-topbar {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }
}