﻿@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');

:root {
    --bg: #f5f3ee;
    --bg-elev: #ffffff;
    --text: #1c1f24;
    --muted: #4b5563;
    --accent: #2f6b4f;
    --accent-contrast: #ffffff;
    --border: #d6d1c8;
    --shadow: 0 16px 40px rgba(26, 24, 20, 0.08);
    --header-bg: rgba(255, 255, 255, 0.8);
}

html[data-theme='dark'] {
    --bg: #0e1114;
    --bg-elev: #141a20;
    --text: #f4f6f8;
    --muted: #b8c0cc;
    --accent: #5ad39f;
    --accent-contrast: #0e1114;
    --border: #2a333d;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(20, 26, 32, 0.85);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(90, 211, 159, 0.12), transparent 45%),
        radial-gradient(circle at 20% 60%, rgba(47, 107, 79, 0.08), transparent 55%),
        var(--bg);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1400px, 96%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 16px;
}

.logo a {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    flex-wrap: nowrap;
}

.nav a {
    white-space: nowrap;
    position: relative;
    padding: 6px 10px;
    border-radius: 999px;
}

.nav a.active {
    color: var(--accent);
    background: rgba(90, 211, 159, 0.12);
    border: 1px solid rgba(90, 211, 159, 0.4);
}

.site-main {
    padding: 48px 0 72px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.button.danger {
    background: #d14343;
    color: #ffffff;
    border: 1px solid rgba(209, 67, 67, 0.8);
    box-shadow: 0 12px 28px rgba(209, 67, 67, 0.25);
}

.button.danger:hover {
    box-shadow: 0 18px 40px rgba(209, 67, 67, 0.35);
}

.button.warning {
    background: #d4a016;
    color: #1b1b1b;
    border: 1px solid rgba(212, 160, 22, 0.8);
    box-shadow: 0 12px 28px rgba(212, 160, 22, 0.25);
}

.button.warning:hover {
    box-shadow: 0 18px 40px rgba(212, 160, 22, 0.35);
}

.button.spaced {
    margin-top: 10px;
}

.button.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.link-button {
    background: none;
    border: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.inline-form {
    display: inline;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    cursor: pointer;
}

html[data-theme='dark'] .icon-sun {
    display: none;
}

html[data-theme='light'] .icon-moon {
    display: none;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 48px;
}

.hero-content h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    margin-bottom: 16px;
}

.hero-content p {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-card {
    padding: 24px;
    border-radius: 24px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.stat-label {
    color: var(--muted);
    font-weight: 500;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    box-shadow: var(--shadow);
}

.card h3 {
    margin-top: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notification-time {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.notification-card-completed {
    background: rgba(27, 143, 90, 0.18);
    border-color: rgba(27, 143, 90, 0.55);
}

.notification-card-cancelled {
    background: rgba(140, 20, 20, 0.22);
    border-color: rgba(209, 67, 67, 0.6);
}

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

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 12px;
    margin: 16px 0;
}

.dl dt {
    font-weight: 600;
    color: var(--muted);
}

.dl dd {
    margin: 0;
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    box-shadow: var(--shadow);
}

.form {
    display: grid;
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-group {
    min-width: 0;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
}

.form-section-title {
    grid-column: 1 / -1;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 6px;
}

select,
textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
}

select option {
    background: var(--bg-elev);
    color: var(--text);
}

input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.field-error {
    color: #d14343;
    font-size: 0.9rem;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(90, 211, 159, 0.12);
    border: 1px solid rgba(90, 211, 159, 0.4);
}

.alert-error {
    background: rgba(209, 67, 67, 0.12);
    color: #d14343;
    border: 1px solid rgba(209, 67, 67, 0.4);
}

.form-hint {
    color: var(--muted);
    font-size: 0.95rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

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

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

.table .actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.badge-available {
    color: #1b8f5a;
    border-color: rgba(27, 143, 90, 0.5);
}

.badge-busy {
    color: #c47f1a;
    border-color: rgba(196, 127, 26, 0.5);
}

.badge-defective,
.badge-disabled {
    color: #d14343;
    border-color: rgba(209, 67, 67, 0.5);
}

.badge-offline,
.badge-pending {
    color: #8a94a6;
    border-color: rgba(138, 148, 166, 0.5);
}

.badge-open { color: #1b8f5a; border-color: rgba(27,143,90,0.5); }
.badge-active { color: #1b8f5a; border-color: rgba(27,143,90,0.5); }
.badge-claimed { color: #c47f1a; border-color: rgba(196,127,26,0.5); }
.badge-confirmed { color: #4f8dd9; border-color: rgba(79,141,217,0.5); }
.badge-in_print { color: #6f4fd9; border-color: rgba(111,79,217,0.5); }
.badge-shipping { color: #d4a016; border-color: rgba(212,160,22,0.6); }
.badge-completed { color: #1b8f5a; border-color: rgba(27,143,90,0.5); }
.badge-cancelled,
.badge-expired { color: #d14343; border-color: rgba(209,67,67,0.5); }

.badge-priority-urgent {
    color: #7f0f0f;
    border-color: rgba(127, 15, 15, 0.6);
    background: rgba(127, 15, 15, 0.12);
}

.badge-priority-high {
    color: #c81d25;
    border-color: rgba(200, 29, 37, 0.6);
    background: rgba(200, 29, 37, 0.12);
}

.badge-priority-normal {
    color: #d4a016;
    border-color: rgba(212, 160, 22, 0.6);
    background: rgba(212, 160, 22, 0.12);
}

.badge-priority-low {
    color: #1b8f5a;
    border-color: rgba(27, 143, 90, 0.6);
    background: rgba(27, 143, 90, 0.12);
}

.badge-notify-open {
    color: #1b8f5a;
    border-color: rgba(27, 143, 90, 0.5);
    background: rgba(27, 143, 90, 0.12);
}

.badge-notify-claimed {
    color: #c47f1a;
    border-color: rgba(196, 127, 26, 0.5);
    background: rgba(196, 127, 26, 0.12);
}

.badge-notify-confirmed {
    color: #4f8dd9;
    border-color: rgba(79, 141, 217, 0.5);
    background: rgba(79, 141, 217, 0.12);
}

.badge-notify-print {
    color: #6f4fd9;
    border-color: rgba(111, 79, 217, 0.5);
    background: rgba(111, 79, 217, 0.12);
}

.badge-notify-shipping {
    color: #d4a016;
    border-color: rgba(212, 160, 22, 0.6);
    background: rgba(212, 160, 22, 0.12);
}

.badge-notify-completed {
    color: #1b8f5a;
    border-color: rgba(27, 143, 90, 0.5);
    background: rgba(27, 143, 90, 0.12);
}

.badge-notify-cancelled {
    color: #d14343;
    border-color: rgba(209, 67, 67, 0.5);
    background: rgba(209, 67, 67, 0.12);
}

.viewer-card {
    min-height: 420px;
}

#viewer {
    width: 100%;
    height: 360px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.viewer-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.viewer-legend {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.role-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.role-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.viewer-message {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    padding: 12px;
    text-align: center;
    background: rgba(0,0,0,0.08);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}
