/* GE-KO Mailing — vizualna identiteta "poštna znamka"
   Paleta: smrekova zelena + papir + žigova rdeča (samo za nevarno/žig). */

@font-face {
    font-family: 'Bricolage';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/assets/fonts/bricolage-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Bricolage';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/assets/fonts/bricolage-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --accent: #0d6b57;
    --accent-dark: #094f40;
    --accent-soft: #dcefe8;
    --paper: #f1f4f0;
    --surface: #ffffff;
    --border: #dfe5df;
    --ink: #182620;
    --muted: #64756e;
    --stamp: #c14a2e;          /* žigova rdeča — nevarna dejanja */
    --stamp-soft: #fae8e2;
    --warn: #96690a;
    --warn-soft: #fbf1d4;
    --ok: #1d7a3d;
    --ok-soft: #e0f2e5;
    --info: #24589e;
    --info-soft: #e2ecfa;
    --radius: 12px;
    --sidebar-w: 232px;
    --display: 'Bricolage', 'Avenir Next', -apple-system, sans-serif;
    --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, .stat-card .stat-value {
    font-family: var(--display);
    letter-spacing: -0.015em;
}

/* ------------------------------------------------------------ postavitev */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #0f2019;
    color: #c8d9d2;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.95rem;
    position: sticky;
    top: 0;
    height: 100vh;
    /* perforiran rob — motiv poštne znamke */
    border-right: none;
    background-image: radial-gradient(circle 3px at 100% 8px, var(--paper) 2.6px, transparent 3px);
    background-size: 6px 16px;
    background-repeat: repeat-y;
    background-position: right 0 top 8px;
}

.brand {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.02rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0;
}
.brand em { font-style: normal; font-weight: 400; color: #7fa79a; }

/* Znamka: bel okvir z notranjim zelenim poljem, rahlo zavrtena */
.brand-mark {
    background: #fff;
    padding: 3px;
    border-radius: 2px;
    width: 38px;
    height: 32px;
    display: inline-flex;
    transform: rotate(-4deg);
    box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}
.brand-mark::before {
    content: 'GK';
    background: var(--accent);
    color: #fff;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px dashed rgba(255, 255, 255, 0.55);
    border-radius: 1px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
    color: #c8d9d2;
    text-decoration: none;
    padding: 0.52rem 0.75rem;
    border-radius: 9px;
    font-size: 0.95rem;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-sep {
    margin: 1.1rem 0.75rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6d8a80;
}

.sidebar-footer { border-top: 1px dashed rgba(255, 255, 255, 0.22); padding-top: 0.85rem; font-size: 0.9rem; }
.user-chip { color: #fff; font-weight: 600; margin-bottom: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-link { background: none; border: none; color: #7fa79a; cursor: pointer; padding: 0; font-size: 0.85rem; }
.btn-link:hover { color: #fff; text-decoration: underline; }

/* Polna širina, odzivno */
.main {
    flex: 1;
    min-width: 0;
    padding: 1.7rem clamp(1.1rem, 3vw, 3rem) 3.5rem;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 2.2vw, 1.9rem); font-weight: 700; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --------------------------------------------------------- kartice, tabele */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.05rem;
    box-shadow: 0 1px 2px rgba(24, 38, 32, 0.04);
}
.card h2 { margin: 0 0 0.8rem; font-size: 1.02rem; font-weight: 700; }

.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.95rem 1.15rem 0.85rem;
    box-shadow: 0 1px 2px rgba(24, 38, 32, 0.04);
    border-top: 3px solid var(--accent);
}
.stat-card .stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1.15; }
.stat-card .stat-label { color: var(--muted); font-size: 0.84rem; margin-top: 0.1rem; }

table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(24, 38, 32, 0.04);
}
table.data th, table.data td { text-align: left; padding: 0.62rem 0.85rem; border-bottom: 1px solid var(--border); font-size: 0.93rem; vertical-align: middle; }
table.data th {
    background: #f7faf7;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px dashed #c9d4cc;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #f8fbf8; }

/* ---------------------------------------------------------------- obrazci */
label { display: block; margin-bottom: 0.85rem; font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="url"], input[type="file"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 0.28rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
/* Textarea se sme raztegovati samo navpično — vodoravno bi ušel iz kartice. */
textarea { resize: vertical; min-height: 2.6rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* Odzivna kartica z obrazcem: raste z zaslonom, na ozkih se prilagodi. */
.form-card { width: 100%; max-width: 880px; }
/* Dvostolpčni obrazec na širokih zaslonih (npr. kontakt: polja levo, dodatno desno). */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.6rem; }
@media (min-width: 900px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .form-span-2 { grid-column: 1 / -1; }
}
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; font-weight: 400; }
.checkbox-label input { width: auto; margin-top: 0.25rem; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 0.82rem; font-weight: 400; margin-top: 0.18rem; }

/* ------------------------------------------------------------------ gumbi */
.btn {
    display: inline-block;
    padding: 0.52rem 1.05rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-danger { background: var(--surface); border-color: var(--stamp); color: var(--stamp); }
.btn-danger:hover { background: var(--stamp); color: #fff; }
.btn-sm { padding: 0.26rem 0.62rem; font-size: 0.83rem; border-radius: 7px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------- značke */
.badge {
    display: inline-block;
    padding: 0.12rem 0.58rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-unconfirmed { background: var(--warn-soft); color: var(--warn); }
.badge-unsubscribed { background: #eceeec; color: #6a6f6a; }
.badge-bounced { background: var(--stamp-soft); color: var(--stamp); }
.badge-gdpr { background: var(--accent-soft); color: var(--accent-dark); }
.badge-draft { background: #eceeec; color: #6a6f6a; }
.badge-scheduled { background: var(--warn-soft); color: var(--warn); }
.badge-sending { background: var(--info-soft); color: var(--info); }
.badge-paused { background: var(--warn-soft); color: var(--warn); }
.badge-sent { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------------- flash sporočila */
.flash { padding: 0.68rem 0.95rem; border-radius: 9px; margin-bottom: 0.9rem; font-size: 0.92rem; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--stamp-soft); color: var(--stamp); }
.flash-info { background: var(--accent-soft); color: var(--accent-dark); }

.muted { color: var(--muted); }
.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 2.8rem 1.2rem;
    background: var(--surface);
    border: 1px dashed #c9d4cc;
    border-radius: var(--radius);
}

/* --------------------------------------------------- javne strani, prijava */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 12%, rgba(13, 107, 87, 0.07), transparent 42%),
        var(--paper);
    padding: 1rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.1rem 2.3rem;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 14px 38px rgba(15, 32, 25, 0.10);
}
.auth-card h1 { font-size: 1.25rem; text-align: center; margin: 0 0 1.2rem; }
.auth-card .brand { color: var(--ink); }
.auth-card .brand em { color: var(--muted); }
.brand-center { justify-content: center; margin-bottom: 1rem; }

/* -------------------------------------------------------------- paginacija */
.pagination { display: flex; gap: 0.3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 0.3rem 0.72rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    text-decoration: none;
    font-size: 0.88rem;
    background: var(--surface);
}
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------ izbirnik predlog */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tpl-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
    text-align: left;
    padding: 0;
    font: inherit;
}
.tpl-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(15, 32, 25, 0.12); transform: translateY(-2px); }
.tpl-card iframe { width: 100%; height: 230px; border: 0; pointer-events: none; background: #eef1ee; }
.tpl-card .tpl-name { padding: 0.6rem 0.85rem; font-weight: 600; font-size: 0.92rem; border-top: 1px dashed #c9d4cc; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 32, 25, 0.55);
    display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1.5rem;
}
.modal {
    background: var(--paper); border-radius: 16px; padding: 1.4rem 1.6rem;
    max-width: 1060px; width: 100%; max-height: 88vh; overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.modal h2 { margin: 0 0 1rem; font-family: var(--display); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media (max-width: 820px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; background-image: none; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .main { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 1.35rem; }
}
