/* LuMen Dashboard — vizuál odpovídá www.lumen.pm
   Dark mode, zlatý akcent, Playfair Display + Inter
*/
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Vrstvení černé */
    --bg-primary:   #0B0B0B;
    --bg-secondary: #141414;
    --bg-elevated:  #1E1E1E;

    /* Lomená bílá */
    --text-primary:   #E5E5E5;
    --text-secondary: #B3B3B3;
    --text-tertiary:  #8C8C8C;

    /* Akcenty */
    --color-gold:      #CCA95B;
    --color-gold-dark: #B8974A;

    /* Stav */
    --color-error:   #C76060;
    --color-success: #5BA871;

    /* Hranice */
    --border: #2A2A2A;

    /* Spacing */
    --spacing-xs: 1rem;
    --spacing-sm: 2rem;
    --spacing-md: 3rem;
    --spacing-lg: 5rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-main: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    min-height: 100vh;
}

a { color: var(--color-gold); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

h1, h2, h3, h4 {
    font-family: var(--font-main);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); font-weight: 500; }

p { margin-bottom: 1rem; }

/* ─── Layout ──────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* ─── Header ──────────────────────────────────────────────────────── */
header.app-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}
header.app-header .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
header .brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-main);
    font-size: 1.4rem;
    color: var(--text-primary);
}
header .brand img { height: 32px; width: auto; }
header nav { display: flex; gap: 1.5rem; align-items: center; }
header nav a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
}
header nav a.active { color: var(--text-primary); }
header nav a:hover { color: var(--text-primary); opacity: 1; background: var(--bg-elevated); }
header nav .email {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* ─── Sections ────────────────────────────────────────────────────── */
section.page {
    padding: 2.5rem 0 4rem;
}

/* ─── Cards ───────────────────────────────────────────────────────── */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card h2 { margin-bottom: 0.5rem; }
.card .meta {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.grid-2 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ─── Budget bar ──────────────────────────────────────────────────── */
.budget {
    margin: 1rem 0;
}
.budget-bar {
    height: 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0.5rem 0;
}
.budget-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-dark));
    border-radius: var(--radius-sm);
    transition: width 0.4s ease;
}
.budget-bar.high > div { background: linear-gradient(90deg, #d8a052, #c76060); }
.budget-pct {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}
.budget-pct.warn { color: #d8a052; }
.budget-pct.crit { color: var(--color-error); }

/* ─── Stats grid ──────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.stat {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 1rem;
}
.stat .label {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat .value {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-family: var(--font-main);
    margin-top: 0.25rem;
}

/* ─── Plan cards ─────────────────────────────────────────────────── */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.plan-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}
.plan-card.current { border-color: var(--color-gold); }
.plan-card .name {
    font-family: var(--font-main);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.plan-card .duration { color: var(--text-tertiary); font-size: 0.9rem; }
.plan-card .price {
    font-family: var(--font-main);
    color: var(--color-gold);
    font-size: 2rem;
    margin: 1rem 0 0.5rem;
}
.plan-card .price small {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-family: var(--font-body);
}
.plan-card .desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.75rem 0 1.5rem;
    flex: 1;
}
.plan-card .badge {
    display: inline-block;
    background: rgba(204, 169, 91, 0.15);
    color: var(--color-gold);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
button, .btn {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}
button:hover, .btn:hover { opacity: 0.92; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ─── Forms ───────────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: 0.75rem; }

label { color: var(--text-secondary); font-size: 0.9rem; }

input[type="email"],
input[type="text"],
textarea {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--color-gold); }

textarea { min-height: 100px; resize: vertical; }

select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    margin-left: 0.5rem;
}

input[type="number"] {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}
input[type="number"]:focus { border-color: var(--color-gold); }

code {
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 0.85rem;
    background: var(--bg-elevated);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Chart.js wrapper — bez fixní výšky parent containeru se chart
   v režimu maintainAspectRatio:false rozjede do nekonečna a způsobí
   "trhané rolování". 320px je rozumný defaultní vizuální cíl. */
.chart-box {
    position: relative;
    height: 320px;
    width: 100%;
}

/* ─── Messages ────────────────────────────────────────────────────── */
.msg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.msg.error   { background: rgba(199,96,96,0.15);  color: var(--color-error); }
.msg.success { background: rgba(91,168,113,0.15); color: var(--color-success); }
.msg.info    { background: rgba(204,169,91,0.10); color: var(--color-gold); }

.muted { color: var(--text-tertiary); font-size: 0.9rem; }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
