/* ══════════════════════════════════════════════════════════
   Autoneum e-Kaizen – Design System
   Primary:  Navy   #1B2A4A
   Accent:   Green  #8DC63F  (Autoneum brand green)
   Surface:  White / #F5F7FA
   ══════════════════════════════════════════════════════════ */
:root {
    /* Brand colours */
    --aut-navy:          #1B2A4A;
    --aut-navy-dark:     #111E36;
    --aut-navy-light:    #253B61;
    --aut-green:         #8DC63F;
    --aut-green-dark:    #7AB82E;
    --aut-green-darker:  #6AA520;
    --aut-gray:          #58595B;
    --aut-gray-light:    #7A7B7D;
    --aut-gray-lighter:  #E8E8E8;

    /* Semantic aliases – keep old names working */
    --autoneum-green:         var(--aut-green);
    --autoneum-green-dark:    var(--aut-green-dark);
    --autoneum-green-darker:  var(--aut-green-darker);
    --autoneum-gray:          var(--aut-gray);
    --autoneum-gray-light:    var(--aut-gray-light);
    --autoneum-gray-lighter:  var(--aut-gray-lighter);

    /* Layout */
    --sidebar-width: 250px;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

a, .btn-link {
    color: var(--autoneum-green);
}

.btn-primary {
    color: #fff;
    background-color: var(--autoneum-green);
    border-color: var(--autoneum-green);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--autoneum-green-dark);
    border-color: var(--autoneum-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(141, 198, 63, 0.3);
}

.btn-secondary {
    background-color: var(--autoneum-gray);
    border-color: var(--autoneum-gray);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--autoneum-gray-light);
    border-color: var(--autoneum-gray-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-info {
    background-color: var(--autoneum-green);
    border-color: var(--autoneum-green);
}

.btn-info:hover {
    background-color: var(--autoneum-green-dark);
    border-color: var(--autoneum-green-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--autoneum-green);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--autoneum-gray);
}

.text-primary {
    color: var(--autoneum-green) !important;
}

.bg-primary {
    background-color: var(--autoneum-green) !important;
}

.bg-info {
    background-color: var(--autoneum-green) !important;
}

.badge.bg-primary {
    background-color: var(--autoneum-green) !important;
}

.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    font-size: 0.85em;
}

.badge.rounded-pill {
    padding: 0.5em 1em;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--autoneum-green);
    box-shadow: 0 0 0 0.2rem rgba(141, 198, 63, 0.25);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.text-muted {
    color: #718096 !important;
}

.bg-light {
    background-color: #f7fafc !important;
}

.alert {
    border-radius: 8px;
    border: none;
}

.list-group-item {
    border-radius: 0;
    transition: all 0.2s ease;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.list-group-item-action:hover {
    background-color: #f7fafc;
    transform: translateX(4px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.spinner-border.text-primary {
    color: var(--autoneum-green) !important;
}

/* Professional animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .table, .alert {
    animation: fadeIn 0.4s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--autoneum-gray-lighter);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--autoneum-gray-light);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT – Sidebar + Main
   ══════════════════════════════════════════════════════════ */

.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--aut-navy);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--aut-navy-light); border-radius: 4px; }

main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #F5F7FA;
}

/* ── Sidebar header / brand ── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none !important;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    background: var(--aut-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-text {
    line-height: 1.15;
}

.sidebar-brand-name {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .4px;
    display: block;
}

.sidebar-brand-sub {
    font-size: .68rem;
    color: rgba(255,255,255,.5);
    letter-spacing: .3px;
}

/* ── Sidebar nav ── */
.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
}

.sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    padding: 1rem 1.25rem .3rem;
    margin: 0;
}

.nav-item-sidebar {
    padding: 0 .6rem;
    margin-bottom: 2px;
}

.nav-link-sidebar {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    border-radius: 8px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-link-sidebar:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.nav-link-sidebar.active {
    background: var(--aut-green);
    color: #fff;
    font-weight: 600;
}

.nav-link-sidebar .nav-icon {
    width: 20px;
    text-align: center;
    opacity: .85;
    font-size: 1rem;
}

.nav-link-sidebar.active .nav-icon { opacity: 1; }

.sidebar-divider {
    border-color: rgba(255,255,255,.1);
    margin: .5rem .6rem;
}

/* ── Sidebar footer (user info) ── */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: .8rem 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--aut-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .7rem;
    color: rgba(255,255,255,.45);
}

/* ── Top bar ── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e8edf2;
    padding: .55rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--aut-gray);
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

/* ── Page content ── */
.content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Footer ── */
.app-footer {
    background: #fff;
    border-top: 1px solid #e8edf2;
    padding: .6rem 1.5rem;
    text-align: center;
    font-size: .75rem;
    color: #9aabb8;
}

/* ══════════════════════════════════════════════════════════
   LANGUAGE SWITCHER
   ══════════════════════════════════════════════════════════ */

.lang-switcher-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.8);
    padding: .25rem .6rem;
    font-size: .85rem;
    border-radius: 6px;
    transition: all .15s;
}

.lang-switcher-btn:hover,
.lang-switcher-btn:focus {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.45);
    color: #fff;
}

/* Topbar variant (light bg) */
.topbar .lang-switcher-btn {
    border-color: #d0dae4;
    color: var(--aut-gray);
    background: #f5f7fa;
}

.topbar .lang-switcher-btn:hover {
    background: #e8edf2;
    color: var(--aut-navy);
}

.lang-dropdown {
    min-width: 150px;
    border: 1px solid #e8edf2;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    padding: .4rem;
    /* Vlastní pozicování (otevíráme přidáním .show, ne Popperem) */
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 4px;
}
.lang-dropdown.show { display: block; }

.lang-item {
    border-radius: 7px;
    font-size: .88rem;
    padding: .45rem .75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.lang-item.active {
    background: var(--aut-green);
    color: #fff;
}

.lang-flag { font-size: 1.1rem; line-height: 1; }
.lang-flag-icon {
    font-size: 1.05rem;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    vertical-align: -2px;
}
.lang-code { font-size: .78rem; font-weight: 600; letter-spacing: .5px; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE – collapse sidebar on mobile
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left .25s ease;
        z-index: 1040;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1039;
    }
    .sidebar-backdrop.show { display: block; }
    .content { padding: 1rem; }
}

/* Doplňkové barvy stavových odznaků (teal/orange) – používané u stavů kaizenu */
.bg-teal { background-color: #20c997 !important; }
.bg-orange { background-color: #fd7e14 !important; }
