/* home.skola.digital: layout and components not present in the compiled Metronic CSS. */

:root {
    --sd-ok: #16a34a;
    --sd-off: #9ca3af;
    --sd-error-bg: #fef2f2;
    --sd-error-fg: #b91c1c;
    --sd-error-border: #fecaca;
    --sd-success-bg: #f0fdf4;
    --sd-success-fg: #15803d;
    --sd-success-border: #bbf7d0;
    --sd-info-bg: #eff6ff;
    --sd-info-fg: #1e40af;
    --sd-info-border: #bfdbfe;
}
.dark {
    --sd-error-bg: rgba(220, 38, 38, .12);
    --sd-error-fg: #fca5a5;
    --sd-error-border: rgba(220, 38, 38, .35);
    --sd-success-bg: rgba(22, 163, 74, .12);
    --sd-success-fg: #86efac;
    --sd-success-border: rgba(22, 163, 74, .35);
    --sd-info-bg: rgba(37, 99, 235, .12);
    --sd-info-fg: #93c5fd;
    --sd-info-border: rgba(37, 99, 235, .35);
}

/* --- App shell --- */
header { height: var(--header-height); }
#sidebar-toggle { margin: -10px; }
#main-content-wrap { padding-top: var(--header-height-mobile); }
#context-topbar {
    position: sticky;
    top: var(--header-height-mobile);
    z-index: 5;
    min-height: var(--toolbar-height);
}

@media (min-width: 1024px) {
    #main-content-wrap {
        padding-top: var(--header-height);
        padding-left: calc(var(--rail-width) + var(--contextbar-width));
    }
    #context-topbar { top: var(--header-height); }
    #header-branding {
        width: calc(var(--contextbar-width) - 1px);
        flex: 0 0 var(--contextbar-width);
    }
}
@media (max-width: 1023px) {
    #header-brand-shell {
        width: auto !important;
        flex: 0 0 auto !important;
    }
}

.kt-dropdown-menu[data-kt-dropdown-menu] { min-width: 250px; }

.sd-logo-mini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--brand-color, #1d4ed8); color: #fff;
    font-weight: 700; font-size: 14px; letter-spacing: -.02em;
}
.sd-brand-mark { font-size: 28px; font-weight: 700; letter-spacing: -.03em; color: var(--brand-color, #1d4ed8); }
.sd-brand-mark span { color: var(--foreground, inherit); opacity: .75; }
.sd-brand-mark-sm { font-size: 16px; }

.sd-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9999px; flex: 0 0 auto;
    background: var(--brand-color, #1d4ed8); color: #fff; font-weight: 600; font-size: 13px;
}
.sd-avatar-lg { width: 52px; height: 52px; font-size: 20px; }

.sd-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 6px; font-size: 14px;
    color: var(--foreground, inherit);
}
.sd-nav-link i { font-size: 16px; color: var(--muted-foreground, #6b7280); }
.sd-nav-link:hover { background: var(--muted, rgba(0,0,0,.04)); }
.sd-nav-link.active { background: var(--muted, rgba(0,0,0,.06)); font-weight: 600; }
.sd-nav-link.active i { color: var(--brand-color, #1d4ed8); }

/* --- Auth --- */
.sd-auth-card { max-width: 380px; }
.sd-auth-aside {
    position: relative; min-height: 320px; order: 2;
    background-color: #2a0b45; background-size: cover; background-position: center; background-repeat: no-repeat;
}
@media (min-width: 1024px) { .sd-auth-aside { margin: 20px; border-radius: 16px; overflow: hidden; } }
.sd-auth-brand { display: flex; justify-content: center; margin-bottom: 6px; }
.sd-auth-brand img { width: 200px; max-width: 100%; height: auto; }
.sd-auth-lead { max-width: 420px; font-size: 15px; line-height: 1.6; }
.sd-local-login summary { cursor: pointer; }
.sd-note { font-size: 13px; color: var(--secondary-foreground, #6b7280); text-align: center; }

/* --- Alerts --- */
.sd-alert { border: 1px solid; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.sd-alert-error { background: var(--sd-error-bg); color: var(--sd-error-fg); border-color: var(--sd-error-border); }
.sd-alert-success { background: var(--sd-success-bg); color: var(--sd-success-fg); border-color: var(--sd-success-border); }
.sd-alert-info { background: var(--sd-info-bg); color: var(--sd-info-fg); border-color: var(--sd-info-border); }

/* --- Grids --- */
.sd-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sd-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; transition: border-color .15s, box-shadow .15s; }
a.sd-tile:hover { border-color: var(--brand-color, #1d4ed8); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.sd-tile-icon { font-size: 26px; color: var(--brand-color, #1d4ed8); margin-bottom: 6px; }
.sd-tile-disabled { opacity: .6; }

.sd-stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.sd-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }

.sd-two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
.sd-detail { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1200px) {
    .sd-two-col { grid-template-columns: 1fr 1fr; }
    .sd-detail { grid-template-columns: minmax(300px, 380px) 1fr; }
}

.sd-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.sd-filters label { min-width: 160px; }
.sd-filter-grow { flex: 1 1 220px; }

/* --- Misc --- */
.sd-table-scroll { overflow-x: auto; }
.sd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.sd-pre { white-space: pre-wrap; font-size: 13px; }
.sd-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.sd-dl dt { color: var(--secondary-foreground, #6b7280); }
.sd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 9999px; margin-right: 6px; vertical-align: middle; }
.sd-dot-ok { background: var(--sd-ok); }
.sd-dot-off { background: var(--sd-off); }
.sd-access-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sd-access-form .kt-input { max-width: 170px; }
.sd-history { display: flex; flex-direction: column; gap: 10px; }
.sd-history li { display: flex; flex-direction: column; gap: 2px; }
.sd-file { max-width: 340px; }

.sd-error-page {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 24px; text-align: center;
}

.sd-narrow { max-width: 480px; }
.sd-form-card { max-width: 760px; }
.sd-form-grid { display: grid; gap: 14px 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .sd-form-grid { grid-template-columns: 1fr 1fr; } }
[hidden] { display: none !important; }

/* Pages without a contextbar: the header shows only the logo above the rail (the branding block
   is sized to the contextbar). On mobile it stays, it holds the menu toggle. */
@media (min-width: 1024px) {
    .sd-no-contextbar #header-brand-shell { width: var(--rail-width) !important; flex: 0 0 var(--rail-width) !important; }
    .sd-no-contextbar #header-brand-shell > div { border-right-width: 0; }
    .sd-no-contextbar #header-branding { display: none; }
}

/* ===================== Home (iCloud-like) ===================== */
body.sd-home {
    background-color: #2a0b45;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
}
/* The header stays solid (white / dark theme background); only the main area shows the image. */
body.sd-home header { background: var(--background, #fff) !important; }
body.sd-home #app-main-content { padding-top: 48px; padding-bottom: 48px; }

.sd-home-grid {
    display: grid; gap: 28px; grid-template-columns: 1fr;
    max-width: 1040px; margin: 0 auto;
}
@media (min-width: 900px) {
    .sd-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sd-home-grid .sd-span-2 { grid-column: span 2; }
    .sd-home-grid .sd-stack { display: flex; flex-direction: column; gap: 28px; }
.sd-home-grid > .sd-align-start { align-self: start; }
    .sd-home-grid .sd-stack > .sd-glass { flex: 1 1 auto; }
}
.sd-stack { display: flex; flex-direction: column; gap: 28px; }
.sd-home-grid > .sd-align-start { align-self: start; }

.sd-glass {
    --glass-bg: rgba(255, 255, 255, .9);
    --glass-head: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .55));
    --glass-border: rgba(255, 255, 255, .6);
    --glass-fg: #1d1d1f;
    --glass-muted: #6e6e73;
    --glass-line: rgba(0, 0, 0, .08);
    --glass-hover: rgba(0, 0, 0, .04);
    position: relative; overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: 0 10px 40px rgba(20, 0, 40, .25), 0 1px 2px rgba(0, 0, 0, .06);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    backdrop-filter: saturate(180%) blur(28px);
    color: var(--glass-fg);
}
.dark .sd-glass {
    --glass-bg: rgba(28, 22, 40, .72);
    --glass-head: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0));
    --glass-border: rgba(255, 255, 255, .1);
    --glass-fg: #f5f5f7;
    --glass-muted: #a1a1a6;
    --glass-line: rgba(255, 255, 255, .08);
    --glass-hover: rgba(255, 255, 255, .06);
}
.sd-glass-head {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; background: var(--glass-head);
    border-bottom: 1px solid var(--glass-line);
}
.sd-glass-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.sd-glass-head p { font-size: 13px; color: var(--glass-muted); margin-top: 2px; }
.sd-glass-empty { padding: 22px; font-size: 14px; color: var(--glass-muted); }

/* Profile card */
.sd-profile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 28px; min-height: 280px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .72), rgba(255, 224, 244, .55)) , var(--glass-bg);
}
.dark .sd-profile { background: linear-gradient(160deg, rgba(60, 30, 80, .6), rgba(28, 22, 40, .7)); }
.sd-profile::before {
    content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, .22), rgba(236, 72, 153, 0) 70%);
}
.sd-profile-avatar {
    width: 112px; height: 112px; border-radius: 50%; padding: 5px; margin-bottom: 18px;
    background: linear-gradient(135deg, #f472b6, #a855f7 55%, #fb923c);
    box-shadow: 0 8px 24px rgba(168, 85, 247, .35);
}
.sd-profile-avatar span {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%;
    background: linear-gradient(160deg, #5b21b6, #9d174d); color: #fff;
    font-size: 38px; font-weight: 700; letter-spacing: -.02em; border: 3px solid rgba(255, 255, 255, .85);
}
.sd-profile-name { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.sd-profile-sub { font-size: 20px; font-weight: 600; color: var(--glass-muted); line-height: 1.2; }
.sd-profile-meta { font-size: 14px; color: var(--glass-muted); margin-top: 6px; }
.sd-profile-role {
    margin-top: 14px; font-size: 13px; font-weight: 700; letter-spacing: .02em;
    padding: 4px 12px; border-radius: 999px; color: #fff;
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

/* App icons */
.sd-app-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 64px; height: 64px; border-radius: 16px; color: #fff; font-size: 30px;
    background: linear-gradient(160deg, #60a5fa, #2563eb);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.sd-app-icon--sm { width: 40px; height: 40px; border-radius: 11px; font-size: 20px; }
.sd-app-icon--brand    { background: linear-gradient(160deg, #c084fc, #7c3aed); }
.sd-app-icon--admin    { background: linear-gradient(160deg, #9ca3af, #4b5563); }
.sd-app-icon--stats    { background: linear-gradient(160deg, #4ade80, #16a34a); }
.sd-app-icon--classes  { background: linear-gradient(160deg, #fbbf24, #ea580c); }
.sd-app-icon--account  { background: linear-gradient(160deg, #fcd34d, #f59e0b); }
.sd-app-icon--moodle   { background: linear-gradient(160deg, #fdba74, #f97316); }
.sd-app-icon--nextcloud{ background: linear-gradient(160deg, #38bdf8, #0369a1); }
.sd-app-icon--bbb      { background: linear-gradient(160deg, #5eead4, #0d9488); }
.sd-app-icon--gitlab   { background: linear-gradient(160deg, #fb923c, #dc2626); }
.sd-app-icon--peertube { background: linear-gradient(160deg, #fda4af, #e11d48); }
.sd-app-icon--proxmox  { background: linear-gradient(160deg, #525252, #171717); }

.sd-launcher {
    display: grid; gap: 22px 10px; padding: 26px 22px 28px;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}
.sd-launch {
    display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center;
    padding: 6px 2px; border-radius: 14px; color: var(--glass-fg);
}
.sd-launch .sd-app-icon { transition: transform .2s cubic-bezier(.2, .8, .3, 1.2), box-shadow .2s ease; }
a.sd-launch:hover .sd-app-icon {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 14px 26px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
a.sd-launch:active .sd-app-icon { transform: translateY(-2px) scale(.98); }
@media (prefers-reduced-motion: reduce) { .sd-launch .sd-app-icon { transition: none; } }
/* Services without a URL yet: grey and inactive until their address is filled in (Django admin → Služby). */
.sd-launch--off { cursor: not-allowed; }
.sd-launch--off .sd-app-icon { filter: grayscale(1); opacity: .45; box-shadow: none; }
.sd-launch--off .sd-launch-label { color: var(--glass-muted); opacity: .75; }
.sd-launch-label { font-size: 13px; font-weight: 500; line-height: 1.2; }

/* Lists inside glass cards */
.sd-list, .sd-list-cols { display: grid; padding: 8px 10px 12px; }
@media (min-width: 640px) { .sd-list-cols { grid-template-columns: 1fr 1fr; column-gap: 8px; } }
.sd-list-item {
    display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px;
    color: var(--glass-fg); border-bottom: 1px solid var(--glass-line);
}
.sd-list-item:hover { background: var(--glass-hover); }
.sd-list-item > i { font-size: 22px; color: #a855f7; width: 26px; text-align: center; }
.sd-list-item strong { display: block; font-size: 15px; font-weight: 600; }
.sd-list-item small { display: block; font-size: 12.5px; color: var(--glass-muted); margin-top: 1px; }
.sd-class-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 36px; padding: 0 8px;
    border-radius: 10px; font-weight: 700; font-size: 13px; color: #fff;
    background: linear-gradient(160deg, #fbbf24, #ea580c);
}

.sd-stat-list { display: grid; gap: 4px; padding: 14px 22px 20px; }
.sd-stat-list > div { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--glass-line); }
.sd-stat-list > div:last-child { border-bottom: 0; }
.sd-stat-list span { font-size: 28px; font-weight: 700; letter-spacing: -.02em; min-width: 56px; }
.sd-stat-list small { font-size: 14px; color: var(--glass-muted); }

/* Messages on the dark background stay readable */
body.sd-home .sd-alert { max-width: 1040px; margin-left: auto; margin-right: auto; }
@media (max-width: 1023px) { body.sd-home { background-attachment: scroll; } }
.sd-app-logo { width: 54%; height: 54%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.sd-launch--off .sd-app-logo { filter: none; }
.sd-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sd-bulk .kt-select { width: auto; min-width: 150px; }
.sd-bulk .kt-input { width: 180px; }
.sd-btn-orange { background: #c2410c; color: #fff; border-color: #c2410c; }
.sd-btn-orange:hover, .sd-btn-orange:focus-visible { background: #9a3412; border-color: #9a3412; color: #fff; }
.sd-btn-orange i { color: #fff; }
