/* ═══════════════════════════════════════════════════════
   Audentes — Global Stylesheet  v2
   Color palette: Royal Purple #7B1FA2 / Deep #4A148C / White
   ═══════════════════════════════════════════════════════ */

:root {
    /* ── App colors ── */
    --purple:        #7B1FA2;
    --purple-dark:   #4A148C;
    --purple-deeper: #38006b;
    --purple-light:  #AB47BC;
    --purple-pale:   #F3E5F5;
    --white:         #FFFFFF;
    --gray-100:      #F5F5F5;
    --gray-200:      #EEEEEE;
    --gray-600:      #757575;
    --shadow:        0 4px 24px rgba(0,0,0,.18);
    --radius:        12px;

    /* ── Backwards-compat aliases (old PHP templates use --red-dark) ── */
    --red:      #7B1FA2;
    --red-dark: #4A148C;
    --red-pale: #F3E5F5;

    /* ── Override Bootstrap danger palette ── */
    --bs-danger:                #7B1FA2;
    --bs-danger-rgb:            123, 31, 162;
    --bs-danger-text-emphasis:  #4A148C;
    --bs-danger-bg-subtle:      #F3E5F5;
    --bs-danger-border-subtle:  #ce93d8;

    /* ── Override Bootstrap primary palette ── */
    --bs-primary:               #7B1FA2;
    --bs-primary-rgb:           123, 31, 162;
    --bs-primary-text-emphasis: #4A148C;
    --bs-primary-bg-subtle:     #F3E5F5;
    --bs-primary-border-subtle: #ce93d8;

    /* ── Bootstrap link color ── */
    --bs-link-color:       #7B1FA2;
    --bs-link-hover-color: #4A148C;
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--gray-100);
    color: #1a1a1a;
    min-height: 100vh;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); text-decoration: underline; }

/* ── Navbar ───────────────────────────────────────────── */
.app-navbar {
    background: var(--purple-dark);
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-navbar .brand {
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
}

.app-navbar .brand .euro-icon {
    background: var(--white);
    color: var(--purple-dark);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
}

.app-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-navbar .nav-user {
    color: rgba(255,255,255,.85);
    font-size: .9rem;
}

.nav-org-badge {
    color: rgba(255,255,255,.9);
    font-size: .82rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
    padding: .2rem .7rem;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown in navbar */
.app-navbar .dropdown-menu {
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    min-width: 200px;
}
.app-navbar .dropdown-item {
    color: #1a1a1a;
    font-size: .9rem;
    padding: .55rem 1rem;
}
.app-navbar .dropdown-item:hover {
    background: var(--purple-pale);
    color: var(--purple-dark);
}
.app-navbar .dropdown-divider { border-color: var(--gray-200); }
.app-navbar .dropdown-toggle::after { vertical-align: .15em; }

.btn-nav {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: var(--white);
    padding: .4rem .9rem;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
    display: inline-block;
}
.btn-nav:hover { background: rgba(255,255,255,.25); color: var(--white); text-decoration: none; }

/* ── Home Page ────────────────────────────────────────── */
.home-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    background: linear-gradient(145deg, var(--purple-dark) 0%, var(--purple) 60%, #6A1B9A 100%);
    padding: 2rem;
}

.home-title {
    color: rgba(255,255,255,.7);
    text-align: center;
    font-size: 1rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.dashboard-svg-wrap {
    position: relative;
    width: min(560px, 90vw);
    height: min(560px, 90vw);
    filter: drop-shadow(0 8px 32px rgba(0,0,0,.35));
}

#dashboard-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sector-path {
    cursor: pointer;
    transition: filter .2s, opacity .2s;
}
.sector-path:hover   { filter: brightness(1.25); opacity: .92; }
.sector-path:active  { filter: brightness(.9); }

.sector-label-group  { pointer-events: none; }
.sector-icon         { font-size: 22px; dominant-baseline: middle; text-anchor: middle; }
.sector-text {
    font-family: 'Inter','Segoe UI',sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    fill: #fff;
    text-anchor: middle;
    dominant-baseline: middle;
    letter-spacing: .03em;
}

.center-circle { pointer-events: none; }

.euro-symbol {
    font-size: 72px;
    font-weight: 900;
    fill: var(--purple-dark);
    text-anchor: middle;
    dominant-baseline: middle;
    font-family: 'Inter','Segoe UI',sans-serif;
}

/* ── Cards / Panels ───────────────────────────────────── */
.card-app {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

/* ── Auth Forms ───────────────────────────────────────── */
.auth-wrapper {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--purple-dark), var(--purple));
    padding: 2rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-card .logo { text-align: center; margin-bottom: 1.5rem; }

.auth-card .logo .euro {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    font-size: 2.2rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(123,31,162,.4);
}

.auth-card h2 { color: var(--purple-dark); font-size: 1.5rem; margin-bottom: .25rem; text-align: center; }
.auth-card .module-badge { text-align: center; color: var(--gray-600); font-size: .88rem; margin-bottom: 1.5rem; }

/* ── Form Controls ────────────────────────────────────── */
.form-label { font-weight: 600; color: var(--purple-dark); font-size: .88rem; margin-bottom: .3rem; }

.form-control:focus, .form-select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 .2rem rgba(123,31,162,.2);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-red, .btn-purple {
    background: var(--purple);
    border: none;
    color: var(--white);
    padding: .6rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s, transform .1s;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
}
.btn-red:hover, .btn-purple:hover   { background: var(--purple-dark); color: var(--white); text-decoration: none; }
.btn-red:active, .btn-purple:active { transform: scale(.97); }

.btn-outline-red, .btn-outline-purple {
    background: transparent;
    border: 2px solid var(--purple);
    color: var(--purple);
    padding: .5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline-red:hover, .btn-outline-purple:hover { background: var(--purple); color: var(--white); text-decoration: none; }

/* ── Section header ───────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--purple-pale);
}

.section-header h1 { font-size: 1.5rem; color: var(--purple-dark); margin: 0; }

.section-icon {
    width: 44px;
    height: 44px;
    background: var(--purple);
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ── Month switcher ───────────────────────────────────── */
.month-switcher { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.month-btn {
    padding: .35rem .75rem;
    border-radius: 20px;
    border: 2px solid var(--purple);
    color: var(--purple);
    background: transparent;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    display: inline-block;
}
.month-btn:hover, .month-btn.active { background: var(--purple); color: var(--white); text-decoration: none; }

/* ── Trips table ──────────────────────────────────────── */
.trips-table { width: 100%; border-collapse: collapse; font-size: .84rem; }

.trips-table th {
    background: var(--purple-dark);
    color: var(--white);
    padding: .55rem .65rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.trips-table td {
    padding: .5rem .65rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.trips-table tr:hover td { background: var(--purple-pale); }

/* ── Waypoints ────────────────────────────────────────── */
.waypoints-list { list-style: none; padding: 0; margin: 0; }

.waypoints-list li {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
}

.wp-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Admin table ──────────────────────────────────────── */
.admin-table { font-size: .88rem; }
.admin-table thead th { background: var(--purple-dark); color: var(--white); border: none; }
.admin-table tbody tr:hover td { background: var(--purple-pale); }

/* ── Badges ───────────────────────────────────────────── */
.badge-admin    { background: var(--purple-dark); color: var(--white); }
.badge-user     { background: #757575;            color: var(--white); }
.badge-active   { background: #388e3c;            color: var(--white); }
.badge-inactive { background: #9e9e9e;            color: var(--white); }

/* ── Modal overrides ──────────────────────────────────── */
.modal-header { background: var(--purple-dark); color: var(--white); }
.modal-header .btn-close { filter: invert(1); }
.modal-title  { font-weight: 700; }

/* ── Google autocomplete ──────────────────────────────── */
.pac-container { z-index: 9999 !important; border-radius: 8px; }

/* ── Trip form row ────────────────────────────────────── */
.trip-row-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--purple);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.trip-row-card .row-number {
    background: var(--purple);
    color: var(--white);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

/* Financial section inside trip row */
.finance-box {
    background: #f9f5ff;
    border: 1px solid #e0d4f5;
    border-radius: 8px;
    padding: 1rem;
    margin-top: .75rem;
}

.finance-value {
    font-weight: 700;
    color: var(--purple-dark);
    font-size: .95rem;
}

.finance-total {
    font-weight: 900;
    color: var(--purple-dark);
    font-size: 1.1rem;
}

.waypoint-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.waypoint-row input { flex: 1; }

/* ── Summary modal ────────────────────────────────────── */
.summary-table td:last-child { font-weight: 700; text-align: right; }
.summary-total { background: var(--purple-pale); font-size: 1.1rem; }
.summary-total td { font-weight: 900 !important; color: var(--purple-dark); }

/* ── Settings panel ───────────────────────────────────── */
.settings-panel {
    background: var(--purple-pale);
    border: 1px solid #d1b0e8;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

/* ── Car cards ────────────────────────────────────────── */
.car-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem;
    transition: border-color .2s, transform .15s;
}
.car-card:hover { border-color: var(--purple); transform: translateY(-2px); }

.car-plate {
    background: var(--purple-dark);
    color: var(--white);
    border-radius: 6px;
    padding: .25rem .6rem;
    font-weight: 700;
    font-size: .9rem;
    display: inline-block;
    letter-spacing: .08em;
}

/* ── Attendance ───────────────────────────────────────── */
.att-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.att-day {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 600;
    background: var(--gray-200);
    cursor: pointer;
    transition: transform .15s;
}
.att-day:hover     { transform: scale(1.08); }
.att-day.present   { background: #a5d6a7; color: #1b5e20; }
.att-day.absent    { background: #ef9a9a; color: #7f0000; }
.att-day.vacation  { background: #90caf9; color: #0d47a1; }
.att-day.sick      { background: #ffe082; color: #6d4c41; }
.att-day.holiday   { background: #ce93d8; color: #4a148c; }
.att-day.today     { outline: 3px solid var(--purple); outline-offset: 1px; }

/* ── Utilities ────────────────────────────────────────── */
.text-purple      { color: var(--purple); }
.text-purple-dark { color: var(--purple-dark); }
.text-red         { color: var(--purple); }
.text-red-dark    { color: var(--purple-dark); }
.bg-purple        { background: var(--purple); }
.bg-purple-pale   { background: var(--purple-pale); }
.bg-red           { background: var(--purple); }
.bg-red-pale      { background: var(--purple-pale); }
.fw-700           { font-weight: 700; }

/* ── Waypoint compact time fields ────────────────────── */
.wp-time-label {
    font-size: .73rem;
    color: #555;
    min-width: 52px;
    font-weight: 600;
}
.wp-date-input { max-width: 138px !important; }
.wp-time-input { max-width: 100px !important; }

.wp-auto-filled {
    background: #ede7f6 !important;
    border-color: #9C27B0 !important;
}

.wp-stop-card {
    background: #f9f5ff;
    border-left: 3px solid #9C27B0;
    border-radius: 6px;
    padding: .5rem .65rem;
    margin-bottom: .35rem;
}

/* ── Custom error alert (purple, no Bootstrap dependency) */
.alert-app-error {
    background: #F3E5F5;
    border: 1px solid #ce93d8;
    border-left: 4px solid #4A148C;
    color: #38006b;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ── Print styles ─────────────────────────────────────── */
@media print {
    .app-navbar, .btn-red, .btn-purple, .btn-nav,
    .btn-outline-red, .btn-outline-purple,
    #btn-print-summary { display: none !important; }
    .modal-dialog { max-width: 100% !important; }
    body { background: white; }
}

/* ── Animations ───────────────────────────────────────── */
@keyframes slideIn { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes pulse   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }

/* ── Override Bootstrap → Purple (all danger + primary) ─ */

/* btn-outline-danger */
.btn-outline-danger,
.btn-outline-danger:not(:disabled):not(.disabled) {
    color:        #4A148C !important;
    border-color: #4A148C !important;
    background:   transparent !important;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger.active,
.show > .btn-outline-danger.dropdown-toggle {
    color:            #fff !important;
    background-color: #4A148C !important;
    border-color:     #4A148C !important;
}

/* btn-danger */
.btn-danger {
    color:            #fff !important;
    background-color: #7B1FA2 !important;
    border-color:     #7B1FA2 !important;
}
.btn-danger:hover { background-color: #4A148C !important; border-color: #4A148C !important; }

/* btn-outline-primary */
.btn-outline-primary {
    color:        #7B1FA2 !important;
    border-color: #7B1FA2 !important;
    background:   transparent !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
    color:            #fff !important;
    background-color: #7B1FA2 !important;
    border-color:     #7B1FA2 !important;
}

/* btn-primary */
.btn-primary {
    color:            #fff !important;
    background-color: #7B1FA2 !important;
    border-color:     #7B1FA2 !important;
}
.btn-primary:hover { background-color: #4A148C !important; border-color: #4A148C !important; }

/* alert-danger */
.alert-danger {
    color:            #38006b !important;
    background-color: #F3E5F5 !important;
    border-color:     #ce93d8 !important;
}

/* text / bg / border helpers */
.text-danger   { color: #4A148C !important; }
.text-primary  { color: #7B1FA2 !important; }
.bg-danger     { background-color: #7B1FA2 !important; }
.border-danger { border-color: #7B1FA2 !important; }

/* form focus ring */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #7B1FA2 !important;
    box-shadow: 0 0 0 .2rem rgba(123,31,162,.25) !important;
}
.form-check-input:checked {
    background-color: #7B1FA2 !important;
    border-color:     #7B1FA2 !important;
}

/* badge */
.badge.bg-danger   { background-color: #7B1FA2 !important; }
.badge.bg-primary  { background-color: #7B1FA2 !important; }
.badge.text-danger { color: #4A148C !important; }

/* Nav tabs purple */
.nav-tabs .nav-link { color: var(--gray-600); border: none; }
.nav-tabs .nav-link:hover { color: #4A148C; background: var(--purple-pale); border-radius: 6px 6px 0 0; }
.nav-tabs .nav-link.active {
    color:        #4A148C !important;
    font-weight:  700;
    border-color: #dee2e6 #dee2e6 #fff !important;
    border-bottom: 3px solid #7B1FA2 !important;
}

/* Bootstrap table */
.table-danger { --bs-table-bg: #F3E5F5; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-svg-wrap { width: 92vw; height: 92vw; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .page-container { margin: 1rem auto; }
    .att-grid { gap: 2px; }
    .trips-table { font-size: .78rem; }
    .trips-table th, .trips-table td { padding: .4rem .4rem; }
}

/* ═══════════════════════════════════════════════════════
   Modul 6 — Huby (mykologická výroba)
   ═══════════════════════════════════════════════════════ */

/* Štatistické dlaždice */
.huby-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.5rem; }
.huby-stat {
    display: block; text-decoration: none; color: inherit;
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1rem 1.1rem; border-left: 5px solid var(--purple);
    transition: transform .12s ease;
}
.huby-stat:hover { transform: translateY(-2px); text-decoration: none; color: inherit; }
.home-subtitle { font-weight: 700; color: var(--purple-dark); font-size: 1.05rem; }
.huby-stat .num   { font-size: 2rem; font-weight: 900; color: var(--purple-dark); line-height: 1; }
.huby-stat .lbl   { font-size: .8rem; color: var(--gray-600); margin-top: .35rem; }
.huby-stat.green  { border-left-color: #2e7d32; }
.huby-stat.green  .num { color: #2e7d32; }
.huby-stat.yellow { border-left-color: #f9a825; }
.huby-stat.yellow .num { color: #f9a825; }
.huby-stat.red    { border-left-color: #c62828; }
.huby-stat.red    .num { color: #c62828; }

/* Veľké akčné tlačidlá */
.huby-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.huby-action {
    background: var(--white); border: 2px solid var(--purple-pale); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.4rem 1rem; cursor: pointer; text-align: center;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
    display: flex; flex-direction: column; align-items: center; gap: .6rem; min-height: 130px; justify-content: center;
}
.huby-action:hover  { transform: translateY(-3px); border-color: var(--purple); background: var(--purple-pale); }
.huby-action:active { transform: scale(.97); }
.huby-action .ico   { font-size: 2.4rem; line-height: 1; }
.huby-action .txt   { font-weight: 700; color: var(--purple-dark); font-size: 1.02rem; }
.huby-action.wide   { grid-column: 1 / -1; }

/* Výber kachličiek vo wizardoch (žiadne písanie) */
.huby-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.huby-pick .tile {
    border: 2px solid var(--gray-200); border-radius: 10px; padding: .75rem; cursor: pointer;
    text-align: center; font-weight: 600; transition: all .1s ease; background: var(--white);
}
.huby-pick .tile:hover    { border-color: var(--purple-light); }
.huby-pick .tile.selected { border-color: var(--purple); background: var(--purple-pale); color: var(--purple-dark); }
.huby-pick .tile small    { display: block; font-weight: 400; color: var(--gray-600); margin-top: .2rem; }

/* Vizuálny výber zoskupený podľa šarže */
.huby-groups { display: flex; flex-direction: column; gap: .55rem; max-height: 52vh; overflow: auto; padding-right: .25rem; }
.huby-group {
    display: flex; gap: .75rem; align-items: flex-start;
    border: 1px solid var(--gray-200); border-radius: 10px; padding: .55rem .65rem; background: var(--white);
}
.huby-group .g-left { min-width: 132px; flex: none; }
.huby-group .g-date { font-size: .72rem; color: var(--gray-600); }
.huby-group .g-code { font-weight: 700; font-family: ui-monospace, monospace; color: var(--purple-dark); word-break: break-all; }
.huby-group .g-units { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; }
.g-unit {
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 8px; padding: .25rem .45rem;
    font-family: ui-monospace, monospace; font-size: .76rem; transition: border-color .1s ease, background .1s ease;
}
.g-unit:hover    { border-color: var(--purple-light); }
.g-unit.selected { border-color: var(--purple); background: var(--purple-pale); }
.g-unit .u-code  { font-weight: 600; }
a.g-unit         { text-decoration: none; color: inherit; }
.g-all-lbl       { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--purple-dark); font-weight: 600; cursor: pointer; margin-bottom: .15rem; }
@media (max-width: 600px) {
    .huby-group { flex-direction: column; gap: .4rem; }
    .huby-group .g-left { min-width: 0; }
}

/* Krokovač počtu (stepper) */
.huby-stepper { display: flex; align-items: center; gap: .75rem; justify-content: center; }
.huby-stepper button {
    width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--purple);
    color: #fff; font-size: 1.8rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.huby-stepper button:active { transform: scale(.92); }
.huby-stepper .val { font-size: 2.4rem; font-weight: 900; color: var(--purple-dark); min-width: 90px; text-align: center; }

/* Tlačidlá výsledkov kontroly */
.huby-result-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .6rem; }

/* Rodokmeň */
.huby-trace { display: flex; flex-direction: column; gap: .4rem; }
.huby-trace .node {
    display: flex; align-items: center; gap: .6rem; background: var(--purple-pale);
    border-radius: 8px; padding: .55rem .8rem;
}
.huby-trace .node .lbl  { font-size: .75rem; color: var(--gray-600); min-width: 110px; }
.huby-trace .node .code { font-weight: 700; color: var(--purple-dark); font-family: ui-monospace, monospace; }
.huby-trace .arrow { text-align: center; color: var(--purple-light); font-size: 1.1rem; }

/* ── Štítky (tlač) ──────────────────────────────────────── */
.label-sheet { display: flex; flex-wrap: wrap; gap: 4mm; padding: 4mm; }
.huby-label {
    border: 1px solid #000; border-radius: 1.5mm; padding: 1.5mm 2mm; display: flex; gap: 1.5mm;
    align-items: center; box-sizing: border-box; background: #fff; color: #000; overflow: hidden; page-break-inside: avoid;
}
.huby-label, .huby-label * { color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.huby-label.small { width: 50mm; height: 30mm; }
.huby-label.big   { width: 70mm; height: 50mm; }
.huby-label .lbl-info { flex: 1; min-width: 0; overflow: hidden; }
.huby-label .lbl-id   { font-weight: 900; font-size: 3mm; line-height: 1.05; font-family: ui-monospace, monospace; word-break: break-all; }
.huby-label.big .lbl-id { font-size: 4.2mm; }
.huby-label .lbl-type { font-size: 2mm; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.huby-label .lbl-meta { font-size: 2mm; line-height: 1.2; margin-top: .4mm; }
.huby-label.big .lbl-meta { font-size: 2.5mm; }
.huby-label .lbl-qr { flex: none; }
.huby-label .lbl-qr img { display: block; }

@media print {
    .no-print { display: none !important; }
    .label-sheet { padding: 0; }
    body { background: #fff; }
}

/* ═══════════════════════════════════════════════════════
   Modul 4 — Projektový manažment (WBS + Gantt + rozpočet)
   ═══════════════════════════════════════════════════════ */
.pm-page { max-width: 1500px; }
.pm-mini { font-size: .78rem; color: var(--gray-600); }

/* Metadáta projektu */
.pm-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; font-size: .85rem; }
.pm-meta span b { color: var(--purple-dark); font-weight: 600; }
.pm-status { display:inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color:#fff; }
.pm-status-planning  { background: #9e9e9e; }
.pm-status-active    { background: #7B1FA2; }
.pm-status-suspended { background: #f39c12; }
.pm-status-completed { background: #2e7d32; }
.pm-status-cancelled { background: #c62828; }

/* Záložky */
.pm-tabs .nav-link { color: var(--gray-600); cursor: pointer; }
.pm-tabs .nav-link.active { color: var(--purple-dark); font-weight: 600; border-color: #dee2e6 #dee2e6 #fff; }
.tab-panel { display: block; }

/* Lišta nástrojov */
.pm-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }

/* Rozdelenie tabuľka / Gantt */
.pm-split { display: flex; align-items: flex-start; gap: 0; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
.pm-grid-wrap { flex: 0 0 auto; overflow-x: auto; max-width: 60%; }
.pm-gantt-wrap { flex: 1 1 auto; overflow-x: auto; border-left: 2px solid var(--gray-200); background:
    repeating-linear-gradient(0deg, #fff, #fff calc(var(--row-h,32px) - 1px), #f3f3f3 32px); }

/* WBS tabuľka */
.pm-grid { border-collapse: collapse; font-size: .82rem; width: 100%; white-space: nowrap; }
.pm-grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--purple-dark); color: #fff;
    font-weight: 600; padding: .35rem .5rem; text-align: left; height: 48px; vertical-align: middle;
}
.pm-grid td { border-bottom: 1px solid var(--gray-200); padding: 0 .4rem; vertical-align: middle; }
.pm-grid .c-wbs  { width: 46px;  color: var(--gray-600); text-align: right; font-variant-numeric: tabular-nums; }
.pm-grid .c-name { min-width: 230px; }
.pm-grid .c-dur  { width: 64px;  text-align: center; font-variant-numeric: tabular-nums; }
.pm-grid .c-date { width: 130px; }
.pm-grid .c-pred { width: 110px; font-size: .78rem; }
.pm-grid .c-prog { width: 56px; }
.pm-grid .c-resp { width: 130px; }
.pm-row.sel { background: var(--purple-pale); }
.pm-row.type-activity { background: #faf4fc; }
.pm-row.type-activity.sel { background: var(--purple-pale); }
.pm-name-wrap { display: flex; align-items: center; gap: .25rem; }
.pm-ico { color: var(--purple); font-size: .7rem; }
.pm-pred { cursor: pointer; }
.pm-pred:hover { text-decoration: underline; color: var(--purple-dark); }
.pm-ms-ico.crit { color: #c62828; font-size: .9rem; }
.pm-row.crit { background: #fff3f3; }
.pm-row.crit.sel { background: var(--purple-pale); }
.pm-row.crit .pm-name { color: #b71c1c; font-weight: 600; }

/* Bunky upraviteľné na mieste */
.pm-cell {
    border: 1px solid transparent; background: transparent; width: 100%;
    padding: .25rem .3rem; font: inherit; font-size: .82rem; border-radius: 4px;
}
.pm-cell:hover { border-color: var(--gray-200); }
.pm-cell:focus { outline: none; border-color: var(--purple); background: #fff; box-shadow: 0 0 0 2px var(--purple-pale); }
.pm-prog { text-align: center; }

/* Ganttov diagram */
#gantt-chart { position: relative; --row-h: 32px; font-size: .75rem; }
.gantt-head { position: sticky; top: 0; z-index: 3; background: var(--purple-dark); color: #fff; }
.gantt-months { position: relative; height: 24px; border-bottom: 1px solid rgba(255,255,255,.3); }
.gantt-month  { position: absolute; top: 0; height: 24px; line-height: 24px; padding-left: 4px;
    border-left: 1px solid rgba(255,255,255,.25); font-weight: 600; overflow: hidden; white-space: nowrap; }
.gantt-ticks  { position: relative; height: 24px; }
.gantt-tick   { position: absolute; top: 0; height: 24px; line-height: 24px; padding-left: 2px;
    border-left: 1px solid rgba(255,255,255,.18); font-size: .68rem; color: rgba(255,255,255,.85); }
.gantt-row { position: absolute; left: 0; height: 32px; border-bottom: 1px solid transparent; cursor: pointer; }
.gantt-row.sel { background: rgba(123,31,162,.10); }
.gantt-bar {
    position: absolute; top: 6px; height: 20px; border-radius: 4px; overflow: hidden;
    background: var(--purple); box-shadow: inset 0 -2px 4px rgba(0,0,0,.15);
}
.gantt-bar.is-activity { background: var(--purple-dark); height: 14px; top: 9px; border-radius: 2px; }
.gantt-bar.is-task { background: var(--purple-light); }
.gantt-progress { position: absolute; left: 0; top: 0; height: 100%; background: rgba(0,0,0,.32); }
.gantt-ms { position: absolute; top: 8px; width: 16px; height: 16px; background: #4A148C;
    transform: rotate(45deg); border: 2px solid #fff; }
.gantt-ms.crit { background: #c62828; box-shadow: 0 0 0 2px rgba(198,40,40,.25); }
.gantt-lbl { position: absolute; top: 8px; white-space: nowrap; color: #333; font-size: .72rem; pointer-events: none; }
.gantt-lbl.crit { color: #c62828; font-weight: 600; }
.gantt-today { position: absolute; width: 2px; background: #e53935; z-index: 1; }
.gantt-deps { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 4; }
.gantt-deps .dep-line { fill: none; stroke: #888; stroke-width: 1.3; }
.gantt-deps .dep-arrow { fill: #888; }

/* Rozpočtová mriežka */
.pm-budget-wrap { overflow-x: auto; }
.pm-budget { border-collapse: collapse; font-size: .82rem; width: 100%; }
.pm-budget th { background: var(--purple-dark); color: #fff; padding: .35rem .5rem; text-align: center; font-weight: 600; border: 1px solid rgba(255,255,255,.2); }
.pm-budget th.grp-elig { background: var(--purple); }
.pm-budget td { border: 1px solid var(--gray-200); padding: 0; }
.pm-budget .c-wbs  { width: 36px; text-align: center; color: var(--gray-600); padding: .25rem; }
.pm-budget .c-bname { min-width: 200px; padding: .25rem .5rem; }
.pm-budget tr.type-activity { background: #faf4fc; }
.b-cell { width: 110px; }
.b-input { width: 100%; border: 1px solid transparent; background: transparent; text-align: right;
    padding: .25rem .4rem; font: inherit; font-size: .8rem; font-variant-numeric: tabular-nums; }
.b-input:hover { border-color: var(--gray-200); }
.b-input:focus { outline: none; border-color: var(--purple); background: #fff; box-shadow: 0 0 0 2px var(--purple-pale); text-align: left; }
.b-input.is-formula { color: var(--purple-dark); font-style: italic; }
.b-input.err { color: #c62828; }
.pm-budget tfoot .b-foot td { background: var(--purple-pale); padding: .35rem .5rem; text-align: right; }

/* Flash */
.pm-flash { position: fixed; bottom: 20px; right: 20px; z-index: 3000; background: #2e7d32; color: #fff;
    padding: .6rem 1rem; border-radius: 8px; box-shadow: var(--shadow); animation: slideIn .25s ease; }
