/*
 * App shell (templates/base.html.twig): left drill-down sidebar, top bar, main area ("sh-"),
 * plus shared page building blocks used by the dashboard and newer pages ("ui-").
 */
:root {
    --sh-navy: #172635; --sh-blue: #3977d5; --sh-bg: #f4f6f9; --sh-text: #1d2936; --sh-muted: #718096;
    --sh-line: #e5eaf0; --sh-green: #16865b; --sh-amber: #b7791f; --sh-red: #c2413b; --sh-shadow: 0 5px 18px rgba(20, 35, 55, .06);
}
body { background: var(--sh-bg); color: var(--sh-text); }

/* ---- Shell ------------------------------------------------------------------------------ */
.sh-sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: var(--sh-navy); color: #d9e3ec; padding: 20px 14px; display: flex; flex-direction: column; z-index: 1030; overflow-y: auto; }
.sh-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; font-weight: 700; font-size: 15px; color: #fff; text-decoration: none; line-height: 1.25; }
.sh-brand:hover { color: #fff; }
.sh-brand small { display: block; color: #91a4b7; font-size: 10px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.sh-brand-mark { height: 34px; width: 34px; flex: none; border-radius: 10px; background: var(--sh-blue); display: grid; place-items: center; font-size: 18px; }
.sh-nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: #8193a5; padding: 12px 12px 7px; }
.sh-nav-item { width: 100%; border: 0; background: transparent; color: #c4d0dc; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 2px 0; text-decoration: none; font-size: 14px; list-style: none; }
.sh-nav-item::-webkit-details-marker { display: none; }
.sh-nav-item:hover, .sh-nav-item.active { background: #2a4054; color: #fff; }
.sh-nav-item:focus-visible, .sh-subitem:focus-visible { outline: 2px solid #8fb4ee; outline-offset: 1px; }
.sh-nav-item .ico { width: 18px; text-align: center; font-size: 16px; flex: none; }
.sh-nav-item .chev { margin-left: auto; color: #8294a6; transition: transform .15s; }
.sh-group[open] > .sh-nav-item .chev { transform: rotate(180deg); }
.sh-group:not([open]) > .sh-nav-item.active { background: #2a4054; }
.sh-group[open] > .sh-nav-item.active { background: transparent; color: #fff; }
.sh-submenu { padding: 2px 0 5px 30px; }
.sh-subitem { display: block; padding: 8px 10px; color: #aebdca; border-radius: 7px; font-size: 13px; text-decoration: none; }
.sh-subitem:hover, .sh-subitem.active { color: #fff; background: #30495e; }
.sh-sidebar-bottom { margin-top: auto; border-top: 1px solid #34485a; padding-top: 14px; }
.sh-workspace { margin-left: 244px; min-height: 100vh; }
.sh-topbar { height: 66px; background: #fff; border-bottom: 1px solid var(--sh-line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 1020; }
.sh-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sh-crumb { color: var(--sh-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-icon-btn { border: 1px solid var(--sh-line); background: #fff; border-radius: 9px; padding: 6px 11px; cursor: pointer; font-size: 16px; }
.sh-mobile-menu { display: none; }
.sh-user { display: flex; align-items: center; gap: 9px; }
.sh-user b { display: block; font-size: 12px; }
.sh-user small { display: block; color: var(--sh-muted); font-size: 10px; }
.sh-avatar { height: 34px; width: 34px; border-radius: 50%; display: grid; place-items: center; background: #e7effc; color: #285da8; font-weight: 700; font-size: 12px; }
.sh-main { max-width: 1440px; margin: 0 auto; padding: 30px 34px 50px; }
.sh-backdrop { display: none; }

@media (max-width: 860px) {
    .sh-sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px #0006; }
    .sh-app.sidebar-open .sh-sidebar { transform: none; }
    .sh-app.sidebar-open .sh-backdrop { display: block; position: fixed; inset: 0; background: #0a141e66; z-index: 1025; }
    .sh-workspace { margin-left: 0; }
    .sh-topbar { padding: 0 16px; }
    .sh-main { padding: 22px 16px 40px; }
    .sh-mobile-menu { display: inline-block; }
    .sh-user > div:last-child { display: none; }
}
@media print {
    .sh-sidebar, .sh-topbar, .sh-backdrop { display: none !important; }
    .sh-workspace { margin-left: 0; }
    .sh-main { padding: 0; max-width: none; }
}

/* ---- Page building blocks ---------------------------------------------------------------- */
.ui-muted { color: var(--sh-muted); }
.ui-positive { color: var(--sh-green) !important; }
.ui-negative { color: var(--sh-red) !important; }
.ui-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.ui-welcome h1 { font-size: 25px; margin: 0 0 5px; font-weight: 700; letter-spacing: -.5px; }
.ui-welcome p { margin: 0; color: var(--sh-muted); }
.ui-date-pill { border: 1px solid var(--sh-line); background: #fff; border-radius: 8px; padding: 8px 12px; color: #526274; white-space: nowrap; font-size: 13px; }
.ui-page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ui-page-header h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.4px; }
.ui-page-header p { margin: 5px 0 0; color: var(--sh-muted); }
.ui-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ui-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 25px 0 13px; }
.ui-section-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.ui-link { color: var(--sh-blue); font-weight: 600; text-decoration: none; font-size: 13px; }
.ui-link:hover { text-decoration: underline; }
.ui-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 9px 14px; font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; border: 1px solid var(--sh-line); background: #fff; color: var(--sh-text); }
.ui-btn:hover { background: #f7f9fb; color: var(--sh-text); }
.ui-btn.primary { background: var(--sh-blue); border-color: var(--sh-blue); color: #fff; }
.ui-btn.primary:hover { background: #2c63b8; color: #fff; }
.ui-card { background: #fff; border: 1px solid var(--sh-line); border-radius: 12px; box-shadow: var(--sh-shadow); }
.ui-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ui-stat { display: block; padding: 17px 18px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.ui-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 35, 55, .1); color: inherit; }
.ui-stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--sh-muted); font-size: 12px; }
.ui-icon { height: 34px; width: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 17px; }
.ui-icon.blue { background: #eaf1fd; color: #3977d5; }
.ui-icon.green { background: #e9f7f1; color: #16865b; }
.ui-icon.purple { background: #f2edfc; color: #8056bd; }
.ui-icon.amber { background: #fff4e5; color: #b7791f; }
.ui-stat strong { display: block; font-size: 27px; margin: 8px 0 2px; letter-spacing: -.5px; }
.ui-stat small { color: var(--sh-muted); }
.ui-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ui-quick { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--sh-line); border-radius: 10px; background: #fff; text-decoration: none; color: var(--sh-text); }
.ui-quick:hover { border-color: #9db9e5; background: #fafdff; color: var(--sh-text); }
.ui-quick b { display: block; font-size: 13px; }
.ui-quick small { color: var(--sh-muted); font-size: 11px; }
.ui-content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; }
.ui-lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.ui-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ui-panel { padding: 18px; }
.ui-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.ui-panel-title h3 { font-size: 14px; font-weight: 700; margin: 0; }
.ui-select { border: 1px solid var(--sh-line); border-radius: 8px; padding: 6px 9px; background: #fff; font-size: 13px; }
.ui-big { font-size: 27px; font-weight: 700; margin: 5px 0; }
.ui-subline { font-size: 12px; color: var(--sh-muted); }
.ui-progress { height: 8px; background: #edf1f5; border-radius: 20px; overflow: hidden; margin: 14px 0 8px; }
.ui-progress span { display: block; height: 100%; max-width: 100%; background: #24956b; border-radius: 20px; }
.ui-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.ui-mini { background: #f7f9fb; border-radius: 9px; padding: 11px; }
.ui-mini b { display: block; font-size: 16px; }
.ui-mini small { color: var(--sh-muted); }
.ui-event { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--sh-line); }
.ui-event:last-child { border: 0; }
.ui-event-date { width: 43px; flex-shrink: 0; text-align: center; border: 1px solid var(--sh-line); border-radius: 8px; padding: 5px; background: #fafbfd; }
.ui-event-date b { font-size: 17px; display: block; line-height: 1.2; }
.ui-event-date small { font-size: 9px; color: var(--sh-muted); font-weight: 700; text-transform: uppercase; }
.ui-event-info { min-width: 0; flex: 1; }
.ui-event-info b { display: block; font-size: 13px; }
.ui-event-info small { color: var(--sh-muted); }
.ui-table-wrap { overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; }
.ui-table th { text-align: left; font-size: 11px; color: var(--sh-muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--sh-line); white-space: nowrap; }
.ui-table td { padding: 12px 10px; border-bottom: 1px solid #edf0f4; font-size: 13px; vertical-align: middle; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-table a { color: var(--sh-blue); text-decoration: none; }
.ui-table a:hover { text-decoration: underline; }
.ui-badge { display: inline-block; padding: 4px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; background: #eaf6ef; color: #16865b; white-space: nowrap; }
.ui-badge.amber { background: #fff5df; color: #9a6815; }
.ui-badge.blue { background: #eaf1fd; color: #3568b5; }
.ui-badge.grey { background: #eef1f4; color: #66778a; }
.ui-activity { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--sh-line); }
.ui-activity:last-child { border: 0; }
.ui-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4e87d9; margin: 5px 2px 0; }
.ui-dot.create { background: var(--sh-green); }
.ui-dot.delete { background: var(--sh-red); }
.ui-activity b { display: block; font-size: 12px; }
.ui-activity small { color: var(--sh-muted); font-size: 11px; }
.ui-empty { padding: 25px; color: var(--sh-muted); text-align: center; font-size: 13px; }
.ui-footer-note { font-size: 11px; color: var(--sh-muted); margin-top: 20px; }
.ui-toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ui-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ui-form-card { max-width: 760px; }
.ui-form-card .ui-panel { padding: 22px; }
.ui-check-list { max-height: 260px; overflow-y: auto; columns: 14rem; border: 1px solid var(--sh-line); border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.ui-check-list .form-check { break-inside: avoid; }
.ui-check-list .form-check[hidden] { display: none; }

@media (max-width: 1050px) {
    .ui-stats, .ui-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .ui-content-grid, .ui-lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ui-two { grid-template-columns: 1fr; }
    .ui-welcome h1 { font-size: 21px; }
    .ui-date-pill { font-size: 11px; }
    .ui-stats, .ui-quick-grid { gap: 9px; }
    .ui-stat { padding: 13px; }
    .ui-stat strong { font-size: 23px; }
    .ui-quick { padding: 10px; }
    .ui-quick small { display: none; }
}
.sh-logout { margin: 0; }
.sh-logout .sh-nav-item { font: inherit; font-size: 14px; text-align: left; }
