/* Built on the Currents design tokens: hairline borders, 12px card radius,
   headings at weight 500, numbers and keys in the mono face. */

/* Shell — sidebar left, content right, matching the other products. */

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 264px;
    padding: 20px 12px;
    background: var(--sidebar, var(--muted));
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    display: block;
    padding: 4px 12px 24px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: var(--tracking-tight, -0.02em);
    color: var(--foreground);
}

.sidebar-nav { flex: 1; }

.sidebar-section {
    margin: 0 0 6px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font-text);
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
}

.sidebar-link svg { width: 18px; height: 18px; flex: none; }

.sidebar-link:hover { background: var(--accent); color: var(--foreground); }

.sidebar-link.is-current {
    background: var(--card);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.sidebar-link.is-danger { color: var(--destructive); }
.sidebar-link.is-danger:hover {
    background: color-mix(in oklch, var(--destructive) 10%, transparent);
    color: var(--destructive);
}

.sidebar-foot { padding-top: 12px; }

.content {
    flex: 1;
    min-width: 0;
    padding: 20px 40px 64px;
}

.content-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.content-user {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-foreground);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--foreground);
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.theme-toggle:hover { background: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }

h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.lede {
    color: var(--muted-foreground);
    font-size: 14px;
    margin: 0 0 32px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

/* Forms */

.field {
    display: block;
    margin-bottom: 16px;
}

.field > span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-family: var(--font-text);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-lg);
}

.field input:focus {
    outline: 3px solid color-mix(in oklch, var(--ring) 50%, transparent);
    outline-offset: 0;
    border-color: var(--ring);
}

.field-error {
    color: var(--destructive);
    font-size: 12px;
    margin-top: 6px;
}

/* Keys */

.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--border);
}
.keys td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--border); }
.keys tr:last-child td { border-bottom: none; }

.key-mask { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--muted);
    color: var(--muted-foreground);
}

.chip-live { background: color-mix(in oklch, var(--rise) 15%, transparent); color: var(--rise); }
.chip-revoked { background: var(--muted); color: var(--muted-foreground); }

.key-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* The one showing of a new key */

.reveal {
    border: 1px solid var(--primary);
    background: color-mix(in oklch, var(--primary) 5%, transparent);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 32px;
}

.reveal h2 { font-size: 16px; margin-bottom: 4px; }

.reveal p { font-size: 13px; color: var(--muted-foreground); margin: 0 0 14px; }

.reveal-key {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reveal-key code {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    white-space: nowrap;
}

.empty {
    padding: 40px 0;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 14px;
}

.messages { list-style: none; padding: 0; margin: 0 0 24px; }

.message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: var(--radius-lg);
    background: color-mix(in oklch, var(--primary) 12%, transparent);
    color: var(--foreground);
    margin-bottom: 8px;
}

/* --breakout is the design system's amber accent; a revoked key that still
   answers for a minute is exactly the kind of thing it is for. */
.message-warning {
    background: color-mix(in oklch, var(--breakout) 14%, transparent);
    border: 1px solid color-mix(in oklch, var(--breakout) 40%, transparent);
}

.message-warning::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    background: var(--breakout);
    /* Lucide triangle-alert, masked so it takes the accent colour. */
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.7 18-8-14a2 2 0 0 0-3.4 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.message-error {
    background: color-mix(in oklch, var(--destructive) 12%, transparent);
    color: var(--destructive);
}

.form-actions { margin-top: 24px; }

.aside { font-size: 13px; color: var(--muted-foreground); margin-top: 20px; text-align: center; }

/* Auth pages — a dark card centred on the brand ground, the way the design
   system uses dark for product moments inside an otherwise light product. */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--background);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-brand { display: flex; align-items: center; margin-bottom: 4px; }

.auth-sub {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--muted-foreground);
}

.auth-card form { display: flex; flex-direction: column; }

.auth-error,
.auth-note {
    margin: 0 0 16px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: var(--radius-lg);
    background: color-mix(in oklch, var(--destructive) 12%, transparent);
    color: var(--destructive);
}

.auth-note {
    background: color-mix(in oklch, var(--primary) 12%, transparent);
    color: var(--foreground);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0 0;
    font-size: 13px;
}

.auth-links a { color: var(--primary); }
.auth-links a:hover { opacity: 0.8; }

/* allauth's own pages render plain markup into the card, so the basics need to
   look right without a hand-written template for each one. */

.auth-card form p { margin: 0 0 16px; }
.auth-card label { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 6px; }
.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[type="password"] {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    font-family: var(--font-text);
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}
.auth-card [data-cbtn] { width: 100%; }
.auth-card a { color: var(--primary); }
.auth-card ul { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13px; }
.auth-card .errorlist { color: var(--destructive); }
