/* ══════════════════════════════════════════════
   CorSuite — main.css
   Tmavé téma, čistě bílý text, čitelné pro všechny
   ══════════════════════════════════════════════ */

/* ── RESET ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    color: #ffffff;
    background: #0f172a;
    line-height: 1.6;
}

a { color: #4ade80; text-decoration: none; }
a:hover { text-decoration: underline; color: #86efac; }

p, span, div, li { color: inherit; }
h1, h2, h3, h4, h5 { color: #ffffff; }

/* ── LAYOUT ─────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    background: #0a0f1e;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.main { flex: 1; padding: 24px 28px; min-width: 0; background: #0f172a; }

/* ── SIDEBAR ─────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 6px; text-decoration: none; }
.brand-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px; color: #fff;
    flex-shrink: 0;
}
.brand-name { font-size: 18px; font-weight: 700; color: #ffffff; letter-spacing: -0.3px; }
.brand:hover { text-decoration: none; }
.brand-sub { font-size: 11px; color: #64748b; padding: 0 20px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { padding: 8px 12px; flex: 1; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: #94a3b8; font-size: 14px;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
    text-decoration: none;
    font-weight: 500;
}
.nav a:hover { background: #1e293b; color: #ffffff; text-decoration: none; }
.nav a.active {
    background: rgba(34,197,94,.15);
    color: #4ade80;
    font-weight: 600;
    border: 1px solid rgba(34,197,94,.2);
}

.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b; }
.logout-link { font-size: 13px; color: #64748b; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logout-link:hover { color: #ffffff; text-decoration: none; }

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.topbar h1 { font-size: 24px; font-weight: 700; color: #ffffff; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.muted { color: #94a3b8; font-size: 13px; }

/* ── CARDS ─────────────────────────────────── */
.card {
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
    padding: 20px;
    margin-bottom: 16px;
    color: #ffffff;
}
.card-title {
    font-size: 14px; font-weight: 700; color: #ffffff;
    margin-bottom: 14px; text-transform: uppercase; letter-spacing: .4px;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-header h2 { font-size: 16px; font-weight: 700; color: #ffffff; }
.link-sm { font-size: 13px; color: #4ade80; }

/* ── STATS ─────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
    text-align: center; padding: 20px 12px;
    background: #1e293b; border: 1px solid #334155; border-radius: 12px;
}
.stat-label { font-size: 12px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 700; color: #ffffff; }
.stat-danger .stat-value { color: #f87171; }
.stat-danger { border-color: rgba(248,113,113,.3); }

/* ── CONTENT GRID ─────────────────────────── */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .content-grid { grid-template-columns: 1fr; } }

/* ── TABLE ─────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; font-size: 12px; font-weight: 700;
    color: #ffffff; text-transform: uppercase; letter-spacing: .4px;
    padding: 11px 12px; border-bottom: 2px solid #334155;
    white-space: nowrap; background: #1a2744;
}
td {
    padding: 12px 12px;
    border-bottom: 1px solid #1e293b;
    font-size: 14px;
    color: #ffffff;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #243044; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── BADGES ─────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-ok { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-warn { background: rgba(250,204,21,.12); color: #fbbf24; border: 1px solid rgba(250,204,21,.3); }
.badge-danger { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.3); }
.badge-neutral { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid #334155; border-radius: 8px;
    background: #1e293b; color: #ffffff; font-size: 14px;
    cursor: pointer; transition: all .15s; white-space: nowrap;
    text-decoration: none; font-weight: 500;
}
.btn:hover { background: #293548; border-color: #475569; text-decoration: none; color: #ffffff; }
.btn-primary { background: #16a34a; border-color: #16a34a; color: #ffffff; font-weight: 700; }
.btn-primary:hover { background: #15803d; border-color: #15803d; color: #ffffff; }
.btn-danger { background: transparent; border-color: rgba(248,113,113,.4); color: #f87171; }
.btn-danger:hover { background: rgba(248,113,113,.1); color: #f87171; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; display: flex; }
.btn-remove { background: none; border: none; color: #64748b; cursor: pointer; font-size: 14px; padding: 2px 6px; }
.btn-remove:hover { color: #f87171; }

/* ── ACTIONS ─────────────────────────────────── */
.actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

/* ── FORMS ─────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 13px; font-weight: 700;
    color: #ffffff; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .3px;
}
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 13px;
    border: 1px solid #334155; border-radius: 8px;
    font-size: 14px; color: #ffffff;
    background: #0f172a; outline: none;
    transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}
.field input::placeholder { color: #475569; }
.field-hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
select option { background: #1e293b; color: #ffffff; }
hr { border: none; border-top: 1px solid #334155; margin: 16px 0; }

/* ── INVOICE EDITOR ─────────────────────────── */
.invoice-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .invoice-layout { grid-template-columns: 1fr; } }
.items-editor { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-editor th { font-size: 12px; font-weight: 700; color: #ffffff; padding: 8px 6px; border-bottom: 2px solid #334155; background: #1a2744; }
.items-editor td { padding: 5px 4px; border-bottom: 1px solid #1e293b; }
.items-editor input, .items-editor select {
    border: 1px solid #334155; border-radius: 5px;
    padding: 5px 7px; font-size: 13px; width: 100%;
    background: #0f172a; color: #ffffff;
}
.totals-box { margin-top: 14px; border-top: 1px solid #334155; padding-top: 10px; }
.total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: #94a3b8; }
.total-row-final { font-size: 17px; font-weight: 700; color: #4ade80; border-top: 1px solid #334155; margin-top: 6px; padding-top: 8px; }

/* ── TERMS ─────────────────────────────────── */
.term-row { padding: 10px 0; border-bottom: 1px solid #1e293b; }
.term-row:last-child { border-bottom: none; }
.term-name { font-size: 14px; color: #ffffff; font-weight: 500; }
.term-date { font-size: 12px; color: #94a3b8; }
.term-urgent .term-name { color: #f87171; font-weight: 700; }
.term-urgent .term-date { color: #f87171; }

/* ── MESSAGES ─────────────────────────────── */
.messages { margin-bottom: 16px; }
.msg { padding: 11px 15px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; color: #ffffff; }
.msg-error, .msg-warning { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.msg-success, .msg-info { background: rgba(34,197,94,.1); color: #86efac; border: 1px solid rgba(34,197,94,.3); }

/* ── AUTH ─────────────────────────────────── */
.auth-page { background: #0a0f1e; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-box { background: #1e293b; border-radius: 16px; border: 1px solid #334155; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 25px 50px rgba(0,0,0,.5); }
.auth-box-wide { max-width: 500px; }
.auth-brand { font-size: 28px; font-weight: 800; color: #4ade80; text-align: center; margin-bottom: 4px; }
.auth-sub { font-size: 14px; color: #94a3b8; text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: #94a3b8; }
.auth-footer a { color: #4ade80; }

/* ── PORTAL ─────────────────────────────────── */
.portal-layout { min-height: 100vh; display: flex; flex-direction: column; background: #0f172a; }
.portal-header { background: #0a0f1e; border-bottom: 1px solid #1e293b; display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; }
.portal-brand { font-size: 18px; font-weight: 700; color: #4ade80; }
.portal-user { font-size: 14px; color: #ffffff; }
.portal-user a { color: #94a3b8; }
.portal-user a:hover { color: #4ade80; }
.portal-main { flex: 1; padding: 28px; max-width: 960px; margin: 0 auto; width: 100%; }

/* ── PWA BANNER ─────────────────────────────── */
.pwa-banner {
    display: flex; align-items: center; gap: 12px;
    background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2);
    border-radius: 10px; padding: 12px 16px; margin-bottom: 20px;
    font-size: 14px; color: #86efac; flex-wrap: wrap;
}

/* ── FOOTER ─────────────────────────────────── */
.footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid #1e293b; font-size: 12px; color: #475569; }
.footer a { color: #475569; }

/* ── EXPORT DROPDOWN ─────────────────────────── */
.export-item { display: block; padding: 10px 16px; font-size: 14px; color: #ffffff; text-decoration: none; transition: background .12s; }
.export-item:hover { background: #243044; text-decoration: none; }

/* ── COMPANY SWITCHER ────────────────────────── */
.company-switcher { padding: 4px 12px 12px; position: relative; }
.company-current {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; background: #0f172a;
    border: 1px solid #334155; border-radius: 8px; cursor: pointer;
    transition: border-color .15s;
}
.company-current:hover { border-color: #4ade80; }
.company-name { font-size: 13px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-arrow { font-size: 10px; color: #64748b; flex-shrink: 0; margin-left: 6px; }
.company-menu {
    display: none; position: absolute; left: 12px; right: 12px;
    top: calc(100% - 4px); background: #1e293b;
    border: 1px solid #334155; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 200; overflow: hidden;
}
.company-item {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 10px 14px; font-size: 13px; color: #ffffff;
    background: none; border: none; cursor: pointer;
    text-align: left; text-decoration: none; transition: background .12s;
}
.company-item:hover { background: #243044; color: #ffffff; text-decoration: none; }
.company-item-active { color: #4ade80; font-weight: 700; }
.company-item-add { color: #4ade80; font-size: 13px; border-top: 1px solid #334155; }

/* ── LANDING PAGE ────────────────────────────── */
.landing { background: #0a0f1e; min-height: 100vh; color: #ffffff; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 48px; border-bottom: 1px solid #1e293b; }
.landing-nav-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #ffffff; text-decoration: none; }
.landing-nav-links { display: flex; gap: 12px; align-items: center; }
.landing-hero { text-align: center; padding: 80px 24px 60px; max-width: 800px; margin: 0 auto; }
.landing-hero h1 { font-size: 48px; font-weight: 800; color: #ffffff; line-height: 1.1; margin-bottom: 20px; }
.landing-hero h1 span { color: #4ade80; }
.landing-hero p { font-size: 18px; color: #94a3b8; margin-bottom: 36px; line-height: 1.6; }
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary { background: #16a34a; color: #ffffff; font-weight: 700; font-size: 15px; padding: 12px 28px; border-radius: 10px; border: none; cursor: pointer; transition: background .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-hero-primary:hover { background: #15803d; text-decoration: none; color: #ffffff; }
.btn-hero-secondary { background: transparent; color: #ffffff; font-weight: 600; font-size: 15px; padding: 12px 28px; border-radius: 10px; border: 1px solid #334155; cursor: pointer; transition: all .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-hero-secondary:hover { border-color: #4ade80; color: #4ade80; text-decoration: none; }
.landing-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding: 0 48px 80px; max-width: 1100px; margin: 0 auto; }
.feature-card { background: #1e293b; border: 1px solid #334155; border-radius: 14px; padding: 24px; }
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature-title { font-size: 15px; font-weight: 700; color: #ffffff; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: #94a3b8; line-height: 1.6; }
.landing-cta { text-align: center; padding: 60px 24px; background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(22,163,74,.05)); border-top: 1px solid #1e293b; border-bottom: 1px solid #1e293b; margin-bottom: 60px; }
.landing-cta h2 { font-size: 32px; font-weight: 700; color: #ffffff; margin-bottom: 12px; }
.landing-cta p { color: #94a3b8; margin-bottom: 28px; font-size: 15px; }
.landing-footer { text-align: center; padding: 24px; font-size: 13px; color: #64748b; border-top: 1px solid #1e293b; }
