@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700;9..144,800&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Base palette */
    --bg: #0c1115;
    --bg-elevated: #11181f;
    --bg-glow: #182129;
    --surface: #1a232c;
    --surface-2: #222e39;
    --surface-3: #2a3744;
    --border: #2a3744;
    --border-strong: #3a4a59;
    --hairline: rgba(255, 255, 255, 0.06);

    /* Text */
    --text: #ecf2f7;
    --text-soft: #c5cdd6;
    --muted: #8a96a3;
    --faint: #5d6975;

    /* Brand accents (kept from original) */
    --gold: #ffb347;
    --gold-soft: rgba(255, 179, 71, 0.16);
    --gold-line: rgba(255, 179, 71, 0.35);
    --sky: #7dd3fc;
    --sky-soft: rgba(125, 211, 252, 0.14);
    --sky-line: rgba(125, 211, 252, 0.35);
    --mint: #6ee7b7;
    --mint-soft: rgba(110, 231, 183, 0.16);
    --mint-line: rgba(110, 231, 183, 0.35);
    --rose: #fb7185;
    --rose-soft: rgba(251, 113, 133, 0.14);

    /* Shadows */
    --shadow-sm: 0 2px 6px rgba(5, 10, 14, 0.25);
    --shadow: 0 18px 40px rgba(5, 10, 14, 0.4);
    --shadow-lg: 0 32px 72px rgba(5, 10, 14, 0.55);
    --glow-gold: 0 0 0 1px var(--gold-line), 0 8px 24px rgba(255, 179, 71, 0.18);

    /* Typography */
    --font-display: 'Fraunces', 'Times New Roman', serif;
    --font-body: 'Geist', 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 999px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-feature-settings: "ss01", "cv11";
    margin: 0;
    min-height: 100vh;
    padding: clamp(16px, 2.2vw, 32px);
    color: var(--text);
    background:
        radial-gradient(640px circle at 12% 8%, rgba(255, 179, 71, 0.12), transparent 60%),
        radial-gradient(540px circle at 88% 12%, rgba(125, 211, 252, 0.13), transparent 65%),
        radial-gradient(460px circle at 60% 92%, rgba(110, 231, 183, 0.10), transparent 70%),
        linear-gradient(160deg, var(--bg) 0%, var(--bg-glow) 100%);
    background-attachment: fixed;
    line-height: 1.55;
    letter-spacing: -0.005em;
    position: relative;
}

/* Grain overlay – tactile, editorial */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.5;
    mix-blend-mode: overlay;
}

main, .page, .container, .form-card, .tab-content, .tab-header, .folder, .table-wrap, .toolbar {
    position: relative;
    z-index: 1;
}

/* Headings */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 0 0 14px;
    color: var(--text);
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.2rem, 4.4vw, 3.4rem);
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.025em;
}

h2 {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.2rem;
    color: var(--text-soft);
}

p {
    margin: 0 0 12px;
    color: var(--text-soft);
}

a {
    text-decoration: none;
    color: var(--gold);
    transition: color 0.2s var(--ease-out);
}

a:hover {
    color: var(--sky);
}

::selection {
    background: var(--gold-soft);
    color: var(--text);
}

/* Mono numerics – IDs, prices, dates */
.mono, .num, .order-id {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "ss01";
    letter-spacing: -0.01em;
}

/* Page layout */
.page {
    max-width: 1100px;
    margin: 0 auto;
}

.page-wide {
    max-width: 1600px;
}

.container {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: clamp(20px, 3vw, 32px);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.form-card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: clamp(20px, 2.8vw, 32px);
    box-shadow: var(--shadow);
}

.form-card > div {
    display: grid;
    gap: 14px;
}

.form-card.compact {
    max-width: 440px;
    margin: 0 auto;
}

.formNoStyle {
    margin: 0;
    padding: 0;
    display: inline-flex;
}

/* Form controls */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background-color: rgba(34, 46, 57, 0.55);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.96rem;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

input[type="file"] {
    cursor: pointer;
    padding: 10px 12px;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold-line);
    background-color: rgba(34, 46, 57, 0.85);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-body);
}

input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
}

/* Buttons – tier system */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    margin: 4px 6px 4px 0;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    background: var(--gold);
    color: #1a1410;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), filter 0.2s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
    line-height: 1;
    white-space: nowrap;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(255, 179, 71, 0.22);
    filter: saturate(1.05);
}

button:active, .btn:active {
    transform: translateY(0);
    box-shadow: none;
}

button:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--gold-line);
    outline-offset: 3px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}

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

.btn-outline:hover {
    background: var(--gold-soft);
    color: var(--text);
    box-shadow: none;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* Tables */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    font-size: 0.92rem;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--hairline);
    color: var(--text);
    vertical-align: middle;
}

th {
    background: rgba(255, 179, 71, 0.06);
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

td {
    background-color: transparent;
}

tr:hover td {
    background-color: rgba(125, 211, 252, 0.04);
}

td a {
    color: var(--sky);
}

td img {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        padding: 16px;
    }

    h1 {
        font-size: 2.1rem;
    }

    .container {
        border-radius: var(--r-lg);
    }

    button {
        width: auto;
    }

    .table-wrap {
        border-radius: var(--r-md);
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 1.9rem;
    }

    input[type="text"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 0.95rem;
    }
}
