/* Colors match the desktop app's theme.py palette, for a consistent feel
   across the desktop app and this dashboard. */
:root {
    --bg: #1a1a20;
    --bg-raised: #242430;
    --bg-input: #202028;
    --border: #33333d;
    --text: #e7e7ea;
    --text-muted: #8a8a94;
    --accent: #5865f2;
    --error: #f24352;
    --success: #3ba55c;
    --warn: #e8a33d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
}

h1 {
    font-size: 20px;
    margin: 0 0 4px;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 24px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin: 16px 0 6px;
}

input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input:disabled,
select:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

button {
    width: 100%;
    margin-top: 24px;
    padding: 10px 12px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #6e79f5;
}

.error {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(242, 67, 82, 0.12);
    border: 1px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    font-size: 13px;
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(88, 101, 242, 0.16);
    color: #b7bdfa;
}

.role-badge.admin {
    background: rgba(242, 67, 82, 0.16);
    color: #f7a5ac;
}

a.logout {
    display: inline-block;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}

a.logout:hover {
    color: var(--text);
}

/* --- Hub page (dashboard.html) -- a scrollable page of stacked panels,
   not the login page's single centered card, so body's flex-centering
   is overridden here. --- */
body.hub {
    display: block;
    align-items: initial;
    justify-content: initial;
    padding: 0 0 64px;
}

/* Shared top nav (base.html) -- every page except login.html */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.top-nav-logo {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-nav-links a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}

.top-nav-links a:hover {
    color: var(--text);
}

.hub-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.hub-header h1 {
    font-size: 22px;
}

.hub-header .subtitle {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hub-shell a.logout {
    margin-top: 4px;
}

.panel {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.panel h2 {
    font-size: 15px;
    margin: 0 0 16px;
}

.hub-shell button {
    width: auto;
    margin-top: 12px;
    padding: 8px 18px;
}

button.secondary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
}

button.secondary:hover {
    background: var(--bg-input);
    border-color: var(--accent);
}

.empty-state {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

/* Notice board */
.notice-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-item {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 12px;
}

.notice-title {
    font-weight: 600;
    font-size: 14px;
}

.notice-body {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: pre-wrap;
}

.notice-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notice-form {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 4px;
}

.notice-form label {
    margin: 12px 0 6px;
}

.notice-form label:first-child {
    margin-top: 0;
}

/* Activity feed */
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: 8px;
    border-left: 3px solid var(--border);
    font-size: 13px;
}

.activity-item.alert {
    border-left-color: var(--error);
    background: rgba(242, 67, 82, 0.08);
}

.activity-meta {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

/* Library -- job cover grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.job-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.job-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    background: linear-gradient(160deg, var(--accent), #3a41a8);
    color: white;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.job-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--text-muted);
}

.job-status.status-done {
    color: var(--success);
}

.job-status.status-failed {
    color: var(--error);
}

.job-status.status-running,
.job-status.status-pending {
    color: var(--warn);
}

.job-pages,
.job-synced {
    font-size: 11px;
    color: var(--text-muted);
}

.job-failed-note {
    color: var(--error);
}

/* Panel header with an inline row of links (e.g. Updates: View all / Manage) */
.panel-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-header-row h2 {
    margin: 0;
}

.panel-header-links {
    display: flex;
    gap: 14px;
}

.panel-header-links a {
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}

.panel-header-links a:hover {
    text-decoration: underline;
}

.blog-post-title {
    color: var(--text);
    text-decoration: none;
}

.blog-post-title:hover {
    color: var(--accent);
}

/* Public updates/blog pages */
.blog-shell {
    max-width: 640px;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-post h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.blog-post-single h1 {
    font-size: 22px;
    margin: 0 0 4px;
}

.blog-post-body {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text);
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

/* Admin post management */
.admin-post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-post-actions form {
    margin: 0;
}

.button-link {
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}

.button-link:hover {
    text-decoration: underline;
}

button.danger {
    width: auto;
    margin-top: 0;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    font-size: 12px;
}

button.danger:hover {
    background: rgba(242, 67, 82, 0.12);
}

/* Marketing/landing page (about.html) -- explicitly a placeholder, kept
   simple; a real designed version comes once there's a demo video and
   the product is more fleshed out. */
.about-shell {
    max-width: 720px;
}

.about-hero {
    text-align: center;
    padding: 40px 0 8px;
}

.about-badge {
    display: inline-block;
    margin: 0 0 16px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
}

.about-hero h1 {
    font-size: 40px;
    margin: 0 0 12px;
}

.about-tagline {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto 28px;
    line-height: 1.5;
}

.about-cta-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.button-link.cta {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.button-link.cta:hover {
    background: #6e79f5;
    text-decoration: none;
}

.button-link.cta.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.button-link.cta.secondary:hover {
    border-color: var(--accent);
}

.about-features {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.about-feature h2 {
    font-size: 14px;
    margin: 0 0 8px;
}

.about-feature p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Sync token reveal */
.token-reveal {
    border-color: var(--success);
}

.token-value {
    display: block;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px dashed var(--success);
    border-radius: 8px;
    font-size: 13px;
    word-break: break-all;
    color: var(--text);
}
