/* =========================================================
   IS OBEC — DESIGN SYSTEM
   Obec Dobrá
   Primární barvy dle logomanuálu:
   #002c52 — tmavě modrá
   #fac200 — žlutá
   Sekundární:
   #dadada / #3b3b3b
   ========================================================= */

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

:root {
    --obec-modra: #002c52;
    --obec-modra-2: #003b6d;
    --obec-modra-3: #00538f;
    --obec-zluta: #fac200;
    --obec-zluta-light: #fff5c9;

    --primary: var(--obec-modra);
    --primary-hover: #003a6b;
    --accent: var(--obec-zluta);

    --bg: #f3f5f7;
    --bg-2: #e9edf1;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f6;

    --text: #18212b;
    --text-2: #46515d;
    --muted: #788491;

    --border: #dfe4e9;
    --border-strong: #cbd3db;

    --success: #198754;
    --warning: #d99200;
    --danger: #c93636;
    --info: #087ea4;

    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-xs: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 5px 20px rgba(0,30,60,.08);
    --shadow-lg: 0 16px 45px rgba(0,30,60,.13);

    --sidebar-width: 265px;
    --topbar-height: 76px;

    --transition: 180ms ease;
}

[data-theme="dark"] {
    --bg: #10161c;
    --bg-2: #0c1116;
    --surface: #172029;
    --surface-2: #1c2731;
    --surface-3: #222e38;

    --text: #edf2f6;
    --text-2: #b9c3cc;
    --muted: #8795a2;

    --border: #2c3944;
    --border-strong: #3b4a57;

    --shadow: 0 5px 25px rgba(0,0,0,.25);
    --shadow-lg: 0 18px 50px rgba(0,0,0,.35);
}

/* ---------- RESET ---------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--obec-zluta);
    color: var(--obec-modra);
}

/* ---------- OBECNÉ ---------- */

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

.main {
    min-width: 0;
    flex: 1;
    margin-left: var(--sidebar-width);
}

.content {
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
    padding: 30px 36px 50px;
}

.card,
.panel,
.table-card,
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

/* ---------- SIDEBAR ---------- */

.sidebar {
    position: fixed;
    z-index: 100;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(165deg, #002c52 0%, #001d36 100%);
    color: #fff;
    box-shadow: 8px 0 35px rgba(0,20,40,.13);
}

.sidebar-brand {
    height: var(--topbar-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.11);
}

.sidebar-brand strong {
    display: block;
    font-size: 14px;
    letter-spacing: .06em;
}

.sidebar-brand small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.57);
    font-size: 9px;
    letter-spacing: .1em;
}

.logo-symbol {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--obec-zluta);
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 18px 12px;
    overflow-y: auto;
}

.nav-caption {
    padding: 20px 12px 7px;
    color: rgba(255,255,255,.38);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .13em;
}

.nav-item {
    min-height: 44px;
    margin: 3px 0;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-radius: 10px;
    color: rgba(255,255,255,.70);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}

.nav-item.active {
    color: var(--obec-modra);
    background: var(--obec-zluta);
    box-shadow: 0 6px 20px rgba(250,194,0,.17);
}

.sidebar-bottom {
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

.user-mini-text {
    min-width: 0;
}

.user-mini-text strong,
.user-mini-text small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-mini-text strong {
    font-size: 12px;
}

.user-mini-text small {
    margin-top: 2px;
    color: rgba(255,255,255,.45);
    font-size: 9px;
}

/* ---------- AVATAR ---------- */

.avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--obec-zluta);
    color: var(--obec-modra);
    font-size: 12px;
    font-weight: 800;
}

/* ---------- TOPBAR ---------- */

.topbar {
    height: var(--topbar-height);
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.02em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}

.icon-button,
.mobile-menu {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2);
    transition: var(--transition);
}

.icon-button:hover,
.mobile-menu:hover {
    border-color: var(--obec-modra);
    color: var(--obec-modra);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--obec-zluta);
}

.mobile-menu {
    display: none;
}

/* ---------- WELCOME ---------- */

.welcome {
    min-height: 135px;
    margin-bottom: 24px;
    padding: 27px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 90% 20%, rgba(250,194,0,.18), transparent 25%),
        linear-gradient(110deg, #002c52, #004979);
    color: #fff;
    box-shadow: var(--shadow);
}

.welcome::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    right: -100px;
    bottom: -150px;
    border: 40px solid rgba(255,255,255,.045);
    border-radius: 50%;
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: rgba(255,255,255,.55);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.welcome h2 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -.04em;
}

.welcome p {
    margin: 7px 0 0;
    color: rgba(255,255,255,.66);
    font-size: 12px;
}

.welcome-date {
    position: relative;
    z-index: 2;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.78);
    font-size: 11px;
    white-space: nowrap;
}

/* ---------- MODULE GRID ---------- */

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.module-card {
    --module-color: #52606d;

    position: relative;
    min-height: 180px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);

    color: var(--text);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.module-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--module-color);
    opacity: .9;
}

.module-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -45px;
    top: -45px;
    border-radius: 50%;
    background: var(--module-color);
    opacity: .035;
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--module-color);
    box-shadow: var(--shadow-lg);
}


/* ---------- IKONA MODULU ---------- */

.module-icon {
    position: relative;
    z-index: 5;

    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 50px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: #fff !important;
    color: var(--module-color) !important;

    box-shadow:
        0 5px 15px rgba(0, 30, 60, .08),
        inset 0 0 0 1px rgba(255,255,255,.65);

    overflow: visible;

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

/* Font Awesome přes klasický <i> */
.module-icon > i,
.module-icon > .fa-solid,
.module-icon > .fa-regular,
.module-icon > .fa-brands {
    display: inline-block !important;
    position: relative !important;
    z-index: 10 !important;

    width: auto !important;
    min-width: 20px;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    color: var(--module-color) !important;
    -webkit-text-fill-color: var(--module-color) !important;

    opacity: 1 !important;
    visibility: visible !important;

    font-size: 21px !important;
    line-height: 1 !important;
    text-align: center !important;

    transform: none !important;
}

/* Font Awesome Solid */
.module-icon > .fa-solid {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* Font Awesome Regular */
.module-icon > .fa-regular {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 400 !important;
}

/*
 * Pokud je použit Font Awesome JS, může <i> nahradit elementem <svg>.
 * Proto explicitně stylujeme i SVG.
 */
.module-icon > svg,
.module-icon .svg-inline--fa {
    display: block !important;
    position: relative !important;
    z-index: 10 !important;

    width: 21px !important;
    height: 21px !important;

    color: var(--module-color) !important;
    fill: var(--module-color) !important;

    opacity: 1 !important;
    visibility: visible !important;

    overflow: visible !important;
}

.module-icon > svg path,
.module-icon .svg-inline--fa path {
    fill: var(--module-color) !important;
    color: var(--module-color) !important;
    opacity: 1 !important;
}

/* Pojistka pro pseudo-element Font Awesome */
.module-icon .fa-solid::before,
.module-icon .fa-regular::before,
.module-icon .fa-brands::before {
    display: inline-block !important;
    color: var(--module-color) !important;
    -webkit-text-fill-color: var(--module-color) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.module-card:hover .module-icon {
    transform: translateY(-2px);
    border-color: var(--module-color);
    box-shadow:
        0 8px 20px rgba(0, 30, 60, .12);
}

[data-theme="dark"] .module-icon {
    background: #fff !important;
    border-color: rgba(255,255,255,.20);
}

/* ---------- OBSAH MODULU ---------- */

.module-content {
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.module-content h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 15px;
    letter-spacing: -.02em;
}

.module-content p {
    margin: 0;
    max-width: 280px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}


/* ---------- ŠIPKA ---------- */

.module-arrow {
    position: absolute;
    right: 19px;
    bottom: 18px;

    color: var(--module-color);

    opacity: .35;
    transition: var(--transition);
}

.module-card:hover .module-arrow {
    opacity: 1;
    transform: translateX(4px);
}


/* ---------- MODULE COLORS ---------- */

.module-card.blue {
    --module-color: #1265a0;
}

.module-card.amber {
    --module-color: #c78900;
}

.module-card.cyan {
    --module-color: #087f9b;
}

.module-card.green {
    --module-color: #21834b;
}

.module-card.violet {
    --module-color: #7251a5;
}

.module-card.yellow {
    --module-color: #c79200;
}

.module-card.red {
    --module-color: #bd3c43;
}

.module-card.orange {
    --module-color: #c56621;
}

.module-card.slate {
    --module-color: #52606d;
}

/* ---------- MODULE COLORS ---------- */

.blue   { color: #1265a0; }
.amber  { color: #c78900; }
.cyan   { color: #087f9b; }
.green  { color: #21834b; }
.violet { color: #7251a5; }
.yellow { color: #c79200; }
.red    { color: #bd3c43; }
.orange { color: #c56621; }
.slate  { color: #52606d; }

/* ---------- BUTTONS ---------- */

.btn {
    min-height: 42px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-primary {
    background: var(--obec-modra);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0,44,82,.18);
}

.btn-accent {
    background: var(--obec-zluta);
    color: var(--obec-modra);
}

.btn-secondary {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

/* ---------- FORMS ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.form-label {
    margin-top: 7px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
}

.form-control,
.form-select,
textarea {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

textarea {
    min-height: 110px;
    padding-top: 11px;
    resize: vertical;
}

.form-control:hover,
.form-select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--obec-modra);
    box-shadow: 0 0 0 3px rgba(0,44,82,.09);
}

/* ---------- ALERT ---------- */

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
}

.alert-info {
    background: #e5f5fa;
    color: #075b73;
}

.alert-success {
    background: #e5f6ec;
    color: #126334;
}

.alert-warning {
    background: #fff4d5;
    color: #805900;
}

.alert-danger {
    background: #fde9e9;
    color: #942c2c;
}

/* ---------- LOGIN ---------- */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    position: relative;
    overflow: hidden;

    /* posun celého login boxu trochu výš */
    transform: translateY(-45px);
}

.login-page > .login-card {
    position: relative;
    z-index: 2;
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0,44,82,.06);
}

.login-page::before {
    width: 520px;
    height: 520px;
    left: -260px;
    top: -210px;
}

.login-page::after {
    width: 700px;
    height: 700px;
    right: -400px;
    bottom: -450px;
}

.login-card {
    position: relative;
    z-index: 2;

    /* původně 430px */
    width: min(500px, 100%);

    /* původně 38px */
    padding: 46px 48px;

    border: 1px solid rgba(0,44,82,.09);
    border-radius: 26px;

    background: rgba(255,255,255,.94);

    box-shadow:
        0 30px 80px rgba(0,32,62,.15);

    backdrop-filter: blur(15px);
}

.login-brand {
    margin-bottom: 42px;

    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand span {
    max-width: 150px;

    color: var(--obec-modra);

    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .08em;
}

.logo-placeholder {
    width: 64px;
    height: 64px;

    display: grid;
    place-items: center;

    border-radius: 16px;

    background: var(--obec-modra);
    color: var(--obec-zluta);

    font-size: 12px;
    font-weight: 900;
}

.login-heading {
    margin-bottom: 26px;
}

.login-heading h1 {
    margin: 0;

    color: var(--obec-modra);

    font-size: 31px;
    letter-spacing: -.04em;
}

.login-heading p {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.login-footer {
    margin-top: 28px;
    padding-top: 20px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    text-align: center;

    font-size: 9px;
}

@media (max-height: 750px) {
    .login-page {
        transform: translateY(-15px);
    }

    .login-card {
        padding: 34px 36px;
    }
}

/* ---------- TABLE ---------- */

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th {
    padding: 13px 15px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: var(--surface-2);
}

/* ---------- BADGE ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 800;
}

.badge-success {
    background: #e5f6ec;
    color: #126334;
}

.badge-warning {
    background: #fff4d5;
    color: #805900;
}

.badge-danger {
    background: #fde9e9;
    color: #942c2c;
}

.badge-info {
    background: #e5f5fa;
    color: #075b73;
}

/* ---------- STAT CARDS ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 7px;
    color: var(--text);
    font-size: 27px;
    font-weight: 800;
}

.stat-change {
    margin-top: 7px;
    color: var(--success);
    font-size: 10px;
}

/* ---------- MODAL ---------- */

.modal-backdrop {
    position: fixed;
    z-index: 500;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,20,40,.55);
    backdrop-filter: blur(5px);
}

.modal {
    width: min(600px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 25px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

/* ---------- TABS ---------- */

.tabs {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 11px 15px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    border-color: var(--obec-zluta);
    color: var(--obec-modra);
}

/* ---------- EMPTY STATE ---------- */

.empty-state {
    padding: 55px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    margin-bottom: 15px;
    font-size: 35px;
    opacity: .35;
}

.empty-state h3 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 15px;
}

.empty-state p {
    margin: 0;
    font-size: 11px;
}

/* ---------- MOBILE ---------- */

@media (max-width: 1250px) {
    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 950px) {
    :root {
        --sidebar-width: 230px;
    }

    .content {
        padding: 25px;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .main {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-menu {
        display: grid;
    }

    .topbar {
        padding: 0 17px;
        gap: 12px;
    }

    .topbar > div:nth-child(2) {
        flex: 1;
    }

    .topbar-user span {
        display: none;
    }

    .content {
        padding: 18px;
    }

    .welcome {
        padding: 23px;
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome h2 {
        font-size: 23px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 150px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 27px;
    }
}

@media (max-width: 420px) {
    .topbar h1 {
        font-size: 17px;
    }

    .breadcrumb {
        display: none;
    }

    .login-page {
        padding: 12px;
    }

    .login-card {
        border-radius: 18px;
        padding: 23px;
    }
}

/* ---------- PRINT ---------- */

@media print {
    .sidebar,
    .topbar,
    .module-card,
    .no-print {
        display: none !important;
    }

    .main {
        margin-left: 0;
    }

    .content {
        padding: 0;
    }
}

/* ---------- UPLOAD / GLOBAL PROGRESS OVERLAY ---------- */

.upload-overlay {
    position: fixed;
    z-index: 99999;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 25, 48, .78);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.upload-overlay.show {
    display: flex !important;
}

.upload-loader-box {
    width: min(430px, 100%);
    padding: 34px;

    text-align: center;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--surface);

    box-shadow:
        0 30px 80px rgba(0, 20, 40, .32);
}

.upload-spinner {
    position: relative;

    width: 72px;
    height: 72px;

    margin: 0 auto 20px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--obec-modra);

    color: #fff;
    font-size: 25px;
}

.upload-spinner i {
    position: relative;
    z-index: 2;
    color: #fff;
}

.upload-spinner::before {
    content: "";

    position: absolute;
    inset: -6px;

    border: 3px solid rgba(250, 194, 0, .20);
    border-top-color: var(--obec-zluta);
    border-right-color: var(--obec-zluta);

    border-radius: 50%;

    animation: uploadSpin .9s linear infinite;
}

@keyframes uploadSpin {
    to {
        transform: rotate(360deg);
    }
}

.upload-loader-box h3 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 18px;
}

.upload-loader-box p {
    margin: 0 0 20px;

    overflow: hidden;

    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.upload-progress {
    width: 100%;
    height: 10px;

    overflow: hidden;

    border-radius: 99px;

    background: var(--surface-3);
}

.upload-progress-bar {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--obec-modra),
            var(--obec-modra-3)
        );

    transition: width .12s linear;
}

.upload-progress-info {
    margin-top: 9px;

    display: flex;
    justify-content: space-between;
    gap: 12px;

    color: var(--text-2);

    font-size: 10px;
    font-weight: 700;
}

.upload-loader-box small {
    display: block;

    margin-top: 20px;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.5;
}

/* Stav dokončování - lze použít přidáním třídy .finishing */
.upload-overlay.finishing .upload-progress-bar {
    width: 100%;
}

.upload-overlay.finishing .upload-spinner::before {
    animation-duration: .6s;
}

/* Stav dokončeno */
.upload-overlay.done .upload-spinner {
    background: var(--success);
}

.upload-overlay.done .upload-spinner::before {
    border-color: rgba(25, 135, 84, .18);
    border-top-color: var(--success);
    border-right-color: var(--success);
}

/* Mobil */
@media (max-width: 520px) {
    .upload-overlay {
        padding: 14px;
    }

    .upload-loader-box {
        padding: 28px 22px;
        border-radius: 16px;
    }

    .upload-spinner {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }

    .upload-loader-box h3 {
        font-size: 16px;
    }

    .upload-progress-info {
        font-size: 9px;
    }
}

/* Při tisku loader nikdy nezobrazovat */
@media print {
    .upload-overlay {
        display: none !important;
    }
}

/* =========================================================
   OZNÁMENÍ / TOPBAR
   ========================================================= */

/*
 * Dropdown je současně řízen HTML atributem hidden.
 * Tím se nikdy nezobrazí při prvním načtení stránky ještě
 * před aplikací CSS nebo při pomalejším načítání stylů.
 */
.notification-dropdown[hidden] {
    display: none !important;
}

.notification-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* ---------- ZVONEČEK ---------- */

.notification-button {
    position: relative;
    overflow: visible;
}

.notification-button > i {
    position: relative;
    z-index: 2;
    font-size: 16px;
    transform-origin: 50% 5%;
}

.notification-button.has-unread {
    border-color: rgba(250, 194, 0, .60);
    color: #b57900;
    background:
        radial-gradient(circle at 78% 20%, rgba(250,194,0,.11), transparent 55%),
        var(--surface);
    box-shadow:
        0 0 0 3px rgba(250,194,0,.07),
        0 5px 16px rgba(0,30,60,.07);
}

.notification-button.has-unread:hover {
    border-color: var(--obec-zluta);
    color: #996600;
}

/* Oranžová tečka pouze pokud existuje nepřečtené oznámení. */
.notification-badge-dot {
    position: absolute;
    z-index: 5;
    top: 4px;
    right: 4px;

    width: 9px;
    height: 9px;

    border: 2px solid var(--surface);
    border-radius: 50%;

    background: #f3a600;

    box-shadow:
        0 0 0 0 rgba(243,166,0,.50),
        0 0 9px rgba(243,166,0,.70);

    animation: notification-dot-pulse 1.9s ease-out infinite;
}

.notification-badge-dot[hidden] {
    display: none !important;
}

@keyframes notification-dot-pulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(243,166,0,.50),
            0 0 9px rgba(243,166,0,.65);
    }
    70% {
        box-shadow:
            0 0 0 7px rgba(243,166,0,0),
            0 0 13px rgba(243,166,0,.75);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(243,166,0,0),
            0 0 8px rgba(243,166,0,.45);
    }
}

/* Vlastní krátká animace zvonku – aktivuje ji JS pouze občas. */
.notification-button.is-ringing > i {
    animation: notification-bell-ring .85s ease-in-out;
}

@keyframes notification-bell-ring {
    0%, 100% { transform: rotate(0deg); }
    12% { transform: rotate(15deg); }
    24% { transform: rotate(-13deg); }
    36% { transform: rotate(11deg); }
    48% { transform: rotate(-9deg); }
    60% { transform: rotate(7deg); }
    72% { transform: rotate(-4deg); }
    84% { transform: rotate(2deg); }
}

/* ---------- DROPDOWN ---------- */

.notification-dropdown {
    position: absolute;
    z-index: 20000;

    top: calc(100% + 12px);
    right: 0;

    width: 390px;
    max-width: calc(100vw - 28px);

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    box-shadow:
        0 22px 55px rgba(0, 30, 60, .18),
        0 4px 12px rgba(0, 30, 60, .06);

    transform-origin: top right;
    animation: notification-dropdown-in .16s ease-out;
}

@keyframes notification-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Malá šipka směrem ke zvonečku. */
.notification-dropdown::before {
    content: "";

    position: absolute;
    z-index: 2;

    top: -6px;
    right: 14px;

    width: 11px;
    height: 11px;

    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);

    background: var(--surface-2);

    transform: rotate(45deg);
}

/* ---------- HLAVIČKA ---------- */

.notification-dropdown-head {
    position: relative;
    z-index: 3;

    min-height: 66px;
    padding: 13px 14px 13px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    border-bottom: 1px solid var(--border);

    background:
        linear-gradient(
            180deg,
            var(--surface-2),
            var(--surface)
        );
}

.notification-dropdown-title {
    min-width: 0;
}

.notification-dropdown-title strong {
    display: block;

    margin: 0;

    color: var(--text);

    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.notification-dropdown-title small {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 500;
}

/* ---------- PŘEČÍST VŠE ---------- */

.notification-text-button {
    appearance: none;
    -webkit-appearance: none;

    min-height: 32px;
    padding: 0 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    flex: 0 0 auto;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface);
    color: var(--text-2);

    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;

    box-shadow: var(--shadow-xs);

    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.notification-text-button i {
    color: var(--obec-modra);
    font-size: 10px;
}

.notification-text-button:hover {
    border-color: rgba(0,44,82,.25);
    background: rgba(0,44,82,.045);
    color: var(--obec-modra);

    transform: translateY(-1px);
}

.notification-text-button:disabled {
    opacity: .45;
    cursor: default;
    transform: none;
}

/* ---------- SEZNAM ---------- */

.notification-dropdown-list {
    max-height: 385px;
    overflow-y: auto;

    background: var(--surface);
}

.notification-dropdown-item {
    position: relative;

    min-height: 68px;
    padding: 11px 14px;

    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: start;

    border-bottom: 1px solid var(--border);

    transition: background var(--transition);
}

.notification-dropdown-item:last-child {
    border-bottom: 0;
}

.notification-dropdown-item:hover {
    background: var(--surface-2);
}

.notification-dropdown-item.unread {
    background:
        linear-gradient(
            90deg,
            rgba(250,194,0,.08),
            rgba(250,194,0,.018) 120px,
            transparent
        );
}

.notification-dropdown-item.unread::after {
    content: "";

    position: absolute;

    top: 17px;
    right: 13px;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #f3a600;
}

.notification-dropdown-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: #e8f3f8;
    color: #075b73;

    font-size: 13px;
}

.notification-dropdown-icon.success {
    background: #e5f6ec;
    color: #126334;
}

.notification-dropdown-icon.warning {
    background: #fff4d5;
    color: #805900;
}

.notification-dropdown-icon.danger {
    background: #fde9e9;
    color: #942c2c;
}

.notification-dropdown-body {
    min-width: 0;

    display: block;

    padding-right: 11px;
}

.notification-dropdown-body strong,
.notification-dropdown-body span,
.notification-dropdown-body small {
    display: block;
}

.notification-dropdown-body strong {
    margin: 0 0 3px;

    overflow: hidden;

    color: var(--text);

    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.notification-dropdown-body span {
    overflow: hidden;

    color: var(--text-2);

    font-size: 9px;
    line-height: 1.45;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-dropdown-body small {
    margin-top: 5px;

    color: var(--muted);

    font-size: 8px;
}

/* ---------- PRÁZDNÝ STAV ---------- */

.notification-dropdown-empty {
    min-height: 128px;
    padding: 25px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: var(--muted);

    text-align: center;

    font-size: 10px;
}

.notification-dropdown-empty i {
    color: var(--border-strong);
    font-size: 21px;
}

/* ---------- PATIČKA ---------- */

.notification-dropdown-footer {
    min-height: 44px;
    padding: 0 15px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border-top: 1px solid var(--border);

    background: var(--surface-2);
    color: var(--obec-modra);

    font-size: 9px;
    font-weight: 800;

    transition:
        background var(--transition),
        color var(--transition);
}

.notification-dropdown-footer i {
    font-size: 9px;
    transition: transform var(--transition);
}

.notification-dropdown-footer:hover {
    background: rgba(0,44,82,.055);
}

.notification-dropdown-footer:hover i {
    transform: translateX(3px);
}

/* ---------- DARK MODE ---------- */

[data-theme="dark"] .notification-dropdown::before {
    background: var(--surface-2);
}

/* ---------- MOBIL ---------- */

@media (max-width: 700px) {
    .notification-dropdown {
        position: fixed;

        top: calc(var(--topbar-height) - 1px);
        right: 12px;
        left: 12px;

        width: auto;
        max-width: none;

        transform-origin: top center;
    }

    .notification-dropdown::before {
        display: none;
    }
}

@media (max-width: 420px) {
    .notification-dropdown-head {
        min-height: 60px;
    }

    .notification-text-button span {
        display: none;
    }

    .notification-text-button {
        width: 32px;
        padding: 0;
    }
}

