/* ── WhatsApp Multi-Session API — Design System ──────────────────────────── */

/* ── CSS Variables ───────────────────────────────────────────────────────── */
:root {
    /* Core Palette */
    --navy: #0f172a;
    --navy-light: #1e293b;
    --navy-mid: #334155;
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --blue-light: #eff6ff;
    --green: #22c55e;
    --green-hover: #16a34a;
    --green-dim: #15803d;
    --red: #ef4444;
    --red-hover: #dc2626;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #334155;
    --black: #020617;

    /* Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 5px;

    /* Shadows */
    --shadow: 0 1px 4px rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .05);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .12), 0 4px 8px rgba(0, 0, 0, .06);

    /* Animation */
    --transition: all .18s ease;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Sidebar width */
    --sidebar-w: 252px;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--black);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

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

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

.text-gray {
    color: var(--gray-500);
}

.text-sm {
    font-size: .85rem;
}

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

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

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

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

.gap-1 {
    gap: .5rem;
}

/* ── App Shell Layout ─────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy) 0%, #0d1526 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    border-right: 1px solid rgba(255, 255, 255, .04);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    margin-bottom: .75rem;
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--white);
}

.sidebar-brand h1 .icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--green) 0%, #16a34a 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(34, 197, 94, .35);
    flex-shrink: 0;
}

.sidebar-brand small {
    display: block;
    font-size: .7rem;
    color: var(--gray-400);
    margin-top: .2rem;
    letter-spacing: .02em;
}

.sidebar-nav {
    flex: 1;
    padding: .25rem .75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .62rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 2px;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--white);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--blue) 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, .35);
}

.nav-item .nav-icon {
    font-size: 1.05rem;
    width: 21px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: .9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
    margin: 0 .75rem .75rem;
    flex-shrink: 0;
}

.sidebar-footer .user-info {
    font-size: .75rem;
    color: var(--gray-400);
    margin-bottom: .6rem;
    word-break: break-all;
    line-height: 1.4;
}

.btn-logout {
    width: 100%;
    padding: .48rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, .5);
    color: var(--red);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    font-family: var(--font);
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

/* ── Mobile Header ────────────────────────────────────────────────────────── */
.mobile-header {
    display: none;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 150;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.mobile-header button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: .15rem;
}

.mobile-header span {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 190;
    backdrop-filter: blur(2px);
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2rem 3rem;
    max-width: calc(var(--sidebar-w) + 900px);
    min-width: 0;
}

/* ── Auth Page ────────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--navy) 0%, #1a2540 50%, var(--navy-mid) 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, .15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 197, 94, .12) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.auth-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: .3rem;
    color: var(--navy);
    letter-spacing: -.02em;
}

.auth-card .subtitle {
    color: var(--gray-500);
    font-size: .875rem;
    margin-bottom: 1.75rem;
}

.auth-toggle {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--gray-500);
}

.auth-toggle a {
    color: var(--blue);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-input {
    width: 100%;
    padding: .62rem .9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: var(--font);
    color: var(--black);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

select.form-input {
    cursor: pointer;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .62rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(59, 130, 246, .25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--blue-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .35);
    transform: translateY(-1px);
}

.btn-green {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(34, 197, 94, .25);
}

.btn-green:hover:not(:disabled) {
    background: var(--green-hover);
    box-shadow: 0 4px 12px rgba(34, 197, 94, .35);
    transform: translateY(-1px);
}

.btn-red {
    background: var(--red);
    color: var(--white);
}

.btn-red:hover:not(:disabled) {
    background: var(--red-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: .38rem .75rem;
    font-size: .78rem;
    border-radius: var(--radius-xs);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow .2s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.1rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.01em;
}

/* ── Section Header ───────────────────────────────────────────────────────── */
.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.025em;
}

.section-header p {
    font-size: .875rem;
    color: var(--gray-500);
    margin-top: .2rem;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge-green {
    background: #dcfce7;
    color: var(--green-dim);
}

.badge-red {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-yellow {
    background: #fef9c3;
    color: #a16207;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── Device List ──────────────────────────────────────────────────────────── */
.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.device-item:last-child {
    border-bottom: none;
}

.device-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    flex: 1;
}

.device-avatar {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.device-name {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-id {
    font-size: .75rem;
    color: var(--gray-400);
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-actions {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

/* ── API Key Display ──────────────────────────────────────────────────────── */
.api-key-display {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: .55rem .85rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.api-key-display code {
    flex: 1;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .8rem;
    color: var(--navy);
    word-break: break-all;
}

/* ── QR Code ──────────────────────────────────────────────────────────────── */
.qr-container {
    text-align: center;
    padding: 1.5rem;
}

.qr-container img {
    max-width: 240px;
    width: 100%;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
}

.qr-status {
    margin-top: .75rem;
    font-size: .85rem;
    color: var(--gray-500);
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: calc(100vw - 2rem);
}

.toast {
    padding: .8rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    color: var(--white);
    box-shadow: var(--shadow-md);
    animation: slideIn .25s ease;
    max-width: 340px;
    word-break: break-word;
}

.toast-success {
    background: var(--green);
}

.toast-error {
    background: var(--red);
}

.toast-info {
    background: var(--blue);
}

@keyframes slideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Modals ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn .2s ease;
    padding: 1rem;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn .2s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(.94);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: .65rem;
}

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

/* ── API Docs ─────────────────────────────────────────────────────────────── */
.docs-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.docs-info-item {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.docs-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
}

.docs-value {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .8rem;
    color: var(--navy);
    background: var(--gray-50);
    padding: .35rem .6rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--gray-200);
    word-break: break-all;
}

.docs-key {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-endpoint {
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 0;
}

.docs-endpoint:last-child {
    border-bottom: none;
}

.docs-endpoint-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .4rem;
    flex-wrap: wrap;
}

.docs-method {
    display: inline-flex;
    align-items: center;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    letter-spacing: .04em;
    flex-shrink: 0;
}

.docs-method-get {
    background: #dbeafe;
    color: #1d4ed8;
}

.docs-method-post {
    background: #dcfce7;
    color: #15803d;
}

.docs-path {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .85rem;
    font-weight: 600;
    color: var(--navy);
    word-break: break-all;
}

.docs-desc {
    font-size: .82rem;
    color: var(--gray-500);
    margin-bottom: .5rem;
}

.docs-params {
    margin-bottom: .5rem;
}

.docs-params-title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    margin-bottom: .3rem;
}

.docs-param {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: .15rem .45rem;
    font-size: .72rem;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    color: var(--navy);
    margin: .15rem .2rem .15rem 0;
}

.docs-param-required {
    color: var(--red);
    font-weight: 700;
    font-size: .65rem;
}

.docs-example-block {
    position: relative;
    background: var(--navy);
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .75rem;
    line-height: 1.75;
    overflow-x: auto;
    word-break: break-all;
    white-space: pre-wrap;
}

.docs-example-block .hl-key {
    color: #93c5fd;
}

.docs-example-block .hl-str {
    color: #86efac;
}

.docs-example-block .hl-muted {
    color: #64748b;
}

.docs-copy-btn {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(255, 255, 255, .1);
    border: none;
    color: var(--gray-300);
    border-radius: 4px;
    padding: .2rem .5rem;
    font-size: .7rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.docs-copy-btn:hover {
    background: var(--blue);
    color: var(--white);
}

.docs-response-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    margin: .6rem 0 .3rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.docs-table th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    padding: .55rem .75rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.docs-table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--navy);
    vertical-align: middle;
}

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

.docs-table code {
    background: var(--gray-50);
    padding: .1rem .4rem;
    border-radius: 3px;
    font-size: .8rem;
    border: 1px solid var(--gray-200);
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}

/* Scrollable table wrapper for mobile */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Plan Cards ───────────────────────────────────────────────────────────── */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.plan-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: var(--shadow);
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-popular {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .3), var(--shadow-md);
}

.plan-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: .25rem 1rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(99, 102, 241, .35);
}

.plan-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: .25rem;
}

.plan-desc {
    font-size: .8rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    min-height: 1rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 1rem;
    letter-spacing: -.02em;
}

.plan-price span {
    font-size: .78rem;
    font-weight: 400;
    color: var(--gray-400);
    letter-spacing: 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem 0;
    font-size: .85rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-btn {
    width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Medium tablets */
@media (max-width: 900px) {
    .main-content {
        padding: 1.5rem 1.5rem 2.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, .3);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem 1rem 2rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .docs-info-grid {
        grid-template-columns: 1fr;
    }

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

    .docs-table th,
    .docs-table td {
        padding: .45rem .5rem;
        font-size: .78rem;
    }

    .device-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .device-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: .25rem;
    }

    .card-header {
        flex-direction: row;
    }

    .modal {
        padding: 1.5rem 1.25rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

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

    .toast-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .main-content {
        padding: .75rem .75rem 2rem;
    }

    .card {
        padding: 1.1rem;
    }

    .section-header {
        margin-bottom: 1rem;
    }

    .btn {
        padding: .55rem 1rem;
        font-size: .82rem;
    }

    .plan-price {
        font-size: 1.6rem;
    }

    .api-key-display {
        flex-direction: column;
        align-items: stretch;
    }

    .docs-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop: hide mobile header */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}