/* =========================================================
   HorecFex Admin UI  –  MTK-inspired sidebar layout
   ========================================================= */

/* --- Reset / base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --adm-sidebar-w: 220px;
    --adm-topbar-h: 56px;

    /* Sidebar */
    --adm-side-bg: #0b3d52;
    --adm-side-text: rgba(255,255,255,0.80);
    --adm-side-hover: rgba(255,255,255,0.10);
    --adm-side-active-bar: #2ecc71;
    --adm-side-active-bg: rgba(255,255,255,0.14);

    /* Topbar */
    --adm-top-bg: #fff;
    --adm-top-border: #e2eaf2;
    --adm-top-text: #3d5166;

    /* Content */
    --adm-body-bg: #f0f4f8;
    --adm-card-bg: #fff;
    --adm-border: #dde6ef;
    --adm-muted: #7a8fa6;

    /* Page title amber */
    --adm-amber: #e8a020;

    /* Stat cards */
    --stat-green: #27ae60;
    --stat-orange: #e67e22;
    --stat-red: #e74c3c;
    --stat-teal: #16a085;
}

/* --- Full-page shell ------------------------------------- */
body.admin-body {
    margin: 0;
    background: var(--adm-body-bg);
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--adm-top-text);
    min-height: 100vh;
    /* override public-site gradient */
    background: var(--adm-body-bg) !important;
}

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

/* =========================================================
   SIDEBAR
   ========================================================= */
.adm-sidebar {
    width: var(--adm-sidebar-w);
    flex-shrink: 0;
    background-color: var(--adm-side-bg);
    background-image: url('/img/admin/bg_menu.jpg');
    background-size: cover;
    background-position: center top;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo area */
.adm-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.adm-logo img {
    height: 52px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Nav */
.adm-nav {
    flex: 1;
    padding: 8px 0;
}

.adm-nav-group {
    margin-bottom: 2px;
}

.adm-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 12px 18px 4px;
    display: block;
}

.adm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--adm-side-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    position: relative;
    transition: background .18s, color .18s;
    white-space: nowrap;
}

/* Active circle indicator */
.adm-nav-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    transition: border-color .18s, background .18s;
}

.adm-nav-item svg {
    flex-shrink: 0;
    opacity: .70;
    width: 16px;
    height: 16px;
}

.adm-nav-item:hover {
    background: var(--adm-side-hover);
    color: #fff;
}

.adm-nav-item:hover::before { border-color: rgba(255,255,255,0.6); }
.adm-nav-item:hover svg { opacity: 1; }

.adm-nav-item.active {
    background: var(--adm-side-active-bg);
    color: #fff;
    font-weight: 500;
}

.adm-nav-item.active::before {
    background: var(--adm-side-active-bar);
    border-color: var(--adm-side-active-bar);
}

.adm-nav-item.active svg { opacity: 1; }

/* Sub-menu */
.adm-nav-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    background: rgba(0,0,0,0.15);
}

.adm-nav-sub.open { display: block; }

.adm-nav-sub a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 48px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    transition: color .15s, background .15s;
}

.adm-nav-sub a:hover,
.adm-nav-sub a.active {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

.adm-nav-toggle { cursor: pointer; }
.adm-nav-toggle .adm-arrow {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform .2s;
    opacity: .5;
}
.adm-nav-toggle.open .adm-arrow { transform: rotate(180deg); }

/* Sidebar footer */
.adm-sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.adm-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
}
.adm-sidebar-footer a:hover { color: #fff; }

/* =========================================================
   TOPBAR
   ========================================================= */
.adm-topbar {
    position: fixed;
    top: 0;
    left: var(--adm-sidebar-w);
    right: 0;
    height: var(--adm-topbar-h);
    background: var(--adm-top-bg);
    border-bottom: 1px solid var(--adm-top-border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: left .25s ease;
}

.adm-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--adm-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.adm-hamburger:hover { background: #f0f4f8; color: var(--adm-top-text); }

.adm-search {
    flex: 1;
    max-width: 320px;
    position: relative;
}
.adm-search input {
    width: 100%;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 7px 12px 7px 36px;
    font-size: 13px;
    outline: none;
    background: #f7fafc;
    color: var(--adm-top-text);
    transition: border-color .15s, box-shadow .15s;
}
.adm-search input:focus {
    border-color: var(--adm-side-active-bar);
    box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
    background: #fff;
}
.adm-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--adm-muted);
    pointer-events: none;
}

.adm-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.adm-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--adm-muted);
    cursor: pointer;
    background: none;
    border: 1px solid var(--adm-border);
    border-radius: 6px;
    padding: 5px 10px;
    transition: border-color .15s;
}
.adm-lang-btn:hover { border-color: #b0bec5; color: var(--adm-top-text); }

.adm-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--adm-top-text);
}

.adm-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71, #16a085);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.adm-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--adm-muted);
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.adm-icon-btn:hover { background: #f0f4f8; color: var(--adm-top-text); }

/* Logout button in topbar */
.adm-logout-btn {
    background: none;
    border: 1px solid var(--adm-border);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--adm-muted);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.adm-logout-btn:hover { border-color: #e74c3c; color: #e74c3c; }

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.adm-main {
    margin-left: var(--adm-sidebar-w);
    padding-top: var(--adm-topbar-h);
    flex: 1;
    min-width: 0;
    transition: margin-left .25s ease;
}

.adm-content {
    padding: 28px 28px 40px;
}

.admin-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

.admin-card {
    width: 100%;
    max-width: 1520px;
    margin: 0 auto;
}

.admin-card .form-control,
.admin-card .form-select,
.admin-card .ck,
.admin-card .ck-editor {
    width: 100%;
}

.admin-card textarea.form-control {
    min-height: 8rem;
}

.admin-card .js-ckeditor + .ck-editor .ck-editor__editable,
.admin-card .ck-editor__editable {
    min-height: 24rem;
}

.admin-card .ck-editor__main {
    min-width: 0;
}

.admin-list-thumb {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #d7e1ec;
    background: #f8fafc;
    flex-shrink: 0;
}

.admin-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
    white-space: nowrap;
}

.admin-table-actions form {
    margin: 0;
}

.admin-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 2rem;
    padding: .38rem .8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #f7fafc;
    color: #405467;
    text-decoration: none;
    font-size: .83rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

.admin-action-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.admin-action-link svg {
    width: .9rem;
    height: .9rem;
    flex-shrink: 0;
}

.admin-action-link-edit {
    background: linear-gradient(135deg, #eef6ff, #e4f2ff);
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.admin-action-link-edit:hover {
    background: linear-gradient(135deg, #dbeafe, #d7eeff);
    border-color: #93c5fd;
    color: #1e40af;
}

.admin-action-link-neutral {
    background: #f8fafc;
    border-color: #d7e1ec;
    color: #475569;
}

.admin-action-link-neutral:hover {
    background: #eef2f7;
    border-color: #c7d2de;
    color: #334155;
}

.admin-action-link-danger {
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    border-color: #fecdd3;
    color: #be123c;
}

.admin-action-link-danger:hover {
    background: linear-gradient(135deg, #ffe4e6, #fecdd3);
    border-color: #fda4af;
    color: #9f1239;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--adm-border);
}

.admin-pagination-summary {
    color: var(--adm-muted);
    font-size: .9rem;
}

.admin-pagination-links {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.admin-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: .45rem .8rem;
    border-radius: 999px;
    border: 1px solid #dbe4ee;
    background: #fff;
    color: #44576b;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

.admin-pagination-link:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    text-decoration: none;
}

.admin-pagination-link.is-active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.admin-pagination-link.is-disabled {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: default;
}

/* Breadcrumb */
.adm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--adm-muted);
    margin-bottom: 6px;
}
.adm-breadcrumb a { color: var(--adm-muted); text-decoration: none; }
.adm-breadcrumb a:hover { color: var(--adm-amber); }
.adm-breadcrumb .sep { opacity: .5; }

/* Page title */
.adm-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--adm-amber);
    text-transform: uppercase;
    margin: 0 0 4px;
    letter-spacing: .02em;
}

.adm-page-subtitle {
    font-size: 13px;
    color: var(--adm-muted);
    margin: 0 0 22px;
}

/* =========================================================
   DASHBOARD SECTIONS
   ========================================================= */

/* Hero row: banner + contact */
.adm-hero-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-bottom: 28px;
}

.adm-banner {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.adm-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.adm-contact-card {
    background: var(--adm-card-bg);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid var(--adm-border);
}

.adm-contact-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--adm-top-text);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--adm-border);
}

.adm-contact-card p {
    font-size: 13px;
    color: var(--adm-muted);
    line-height: 1.6;
    margin: 0 0 14px;
}

.adm-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 13px;
    color: var(--adm-top-text);
    margin-bottom: 7px;
}
.adm-contact-item svg { flex-shrink: 0; margin-top: 2px; color: var(--adm-amber); }
.adm-contact-item strong { color: var(--adm-muted); font-weight: 600; margin-right: 3px; }

/* Stats section */
.adm-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.adm-stats-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--adm-top-text);
    margin: 0;
}

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

.adm-stat-card {
    border-radius: 8px;
    padding: 20px 18px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
}

.adm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: #fff;
}

.adm-stat-card.green  { background: #27ae60; }
.adm-stat-card.orange { background: #e67e22; }
.adm-stat-card.red    { background: #e74c3c; }
.adm-stat-card.teal   { background: #2980b9; }

.adm-stat-info { flex: 1; }
.adm-stat-label {
    font-size: 13px;
    font-weight: 400;
    opacity: .92;
    margin: 0 0 6px;
}
.adm-stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.adm-stat-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.20);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 12px;
}
.adm-stat-icon svg { width: 28px; height: 28px; }

/* Month badge */
.adm-month-badge {
    font-size: 13px;
    color: var(--adm-muted);
    border: 1px solid var(--adm-border);
    border-radius: 6px;
    padding: 5px 12px;
    background: #fff;
}

/* Page footer */
.adm-page-footer {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--adm-border);
    text-align: center;
    font-size: 13px;
    color: var(--adm-muted);
}

/* Generic admin card */
.adm-card {
    background: var(--adm-card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid var(--adm-border);
    margin-bottom: 24px;
}

.adm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--adm-border);
}

.adm-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--adm-top-text);
    margin: 0;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
body.admin-login-body {
    margin: 0;
    min-height: 100vh;
    background: url('/img/admin/bg_login.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.adm-login-card {
    background: rgba(255,255,255,0.97);
    border-radius: 16px;
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.adm-login-logo {
    display: block;
    margin: 0 auto 28px;
    height: 64px;
    object-fit: contain;
}

.adm-login-card .form-control {
    border-radius: 8px;
    border: 1px solid #d0dae4;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
    text-align: left;
}
.adm-login-card .form-control:focus {
    border-color: var(--adm-side-active-bar);
    box-shadow: 0 0 0 3px rgba(46,204,113,0.14);
}

.adm-login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27ae60, #16a085);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .05em;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .18s, transform .18s;
    text-transform: uppercase;
}
.adm-login-btn:hover { opacity: .9; transform: translateY(-1px); }

.adm-login-links {
    margin-top: 16px;
    font-size: 13px;
}
.adm-login-links a { color: var(--adm-muted); text-decoration: none; }
.adm-login-links a:hover { color: var(--adm-side-active-bar); }

/* =========================================================
   SIDEBAR COLLAPSED (toggled by JS)
   ========================================================= */
.adm-shell.sidebar-collapsed .adm-sidebar { transform: translateX(-100%); }
.adm-shell.sidebar-collapsed .adm-topbar  { left: 0; }
.adm-shell.sidebar-collapsed .adm-main    { margin-left: 0; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .adm-hero-row { grid-template-columns: 1fr; }
    .adm-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .adm-stats-grid { grid-template-columns: 1fr 1fr; }
    .adm-content { padding: 16px; }
    .adm-topbar { padding: 0 14px; }
    .adm-search { max-width: 180px; }
    .admin-card {
        max-width: 100%;
    }
    .admin-card .ck-editor__editable {
        min-height: 18rem;
    }
}

@media (max-width: 768px) {
    .adm-sidebar { transform: translateX(-100%); }
    .adm-topbar { left: 0; }
    .adm-main { margin-left: 0; }
    .adm-shell.sidebar-open .adm-sidebar { transform: translateX(0); }
}

/* ── Search-select component ───────────────────────────────────────────────── */
.ss-wrapper {
    position: relative;
}

.ss-display {
    width: 100%;
    text-align: left;
    background-color: var(--bs-body-bg, #fff);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-display.ss-placeholder {
    color: #6c757d;
}

.ss-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ss-search-wrap {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.ss-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.ss-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.ss-item:hover {
    background-color: #f8f9fa;
}

.ss-item--selected {
    background-color: #e7f1ff;
    font-weight: 500;
    color: #0d6efd;
}

.ss-item--selected:hover {
    background-color: #dce8fd;
}

.ss-item--placeholder {
    color: #6c757d;
}

.ss-no-results {
    padding: 8px 12px;
    color: #6c757d;
    font-size: 0.875rem;
    font-style: italic;
}

.ss-create-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    color: #0d6efd;
    font-size: 0.9375rem;
    cursor: pointer;
    text-align: left;
}

.ss-create-btn:hover {
    background-color: #f0f7ff;
}

.ss-create-icon {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

/* Agenda tree table */
.agenda-tree-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem 0;
}

.agenda-tree-filter {
    margin-top: 1.5rem;
    padding: 0 1.75rem 1.25rem;
    border-bottom: 1px solid #e7edf4;
}

.agenda-tree-empty {
    margin: 1.5rem 1.75rem 0;
    border: 1px dashed #cfd9e5;
    border-radius: 1rem;
    padding: 2rem;
    background: linear-gradient(180deg, #fcfdff 0%, #f6f9fc 100%);
    text-align: center;
}

.agenda-tree-shell {
    margin: 1.5rem 1.75rem 0;
    border: 1px solid #dbe4ee;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
}

.agenda-tree-head,
.agenda-tree-row {
    display: grid;
    grid-template-columns: minmax(22rem, 2.3fr) minmax(12rem, 1.2fr) minmax(11rem, 1fr) 8rem minmax(16rem, 1.2fr);
    gap: 1rem;
    align-items: center;
}

.agenda-tree-head {
    padding: .95rem 1.25rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
    border-bottom: 1px solid #dde6ef;
    color: #6c8094;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.agenda-tree-body {
    padding: .65rem 0;
}

.agenda-tree-node {
    position: relative;
}

.agenda-tree-row {
    padding: .9rem 1.25rem;
    border-top: 1px solid #edf2f7;
    min-height: 5rem;
}

.agenda-tree-body > .agenda-tree-node:first-child > .agenda-tree-row {
    border-top: 0;
}

.agenda-tree-main {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    min-width: 0;
}

.agenda-tree-toggle,
.agenda-tree-toggle-placeholder {
    width: 1.45rem;
    min-width: 1.45rem;
    height: 1.45rem;
    margin-top: .05rem;
}

.agenda-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d3deea;
    border-radius: 999px;
    background: #fff;
    color: #527ba6;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.agenda-tree-toggle:hover {
    border-color: #9bbce0;
    background: #f8fbff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.agenda-tree-toggle-icon {
    width: .46rem;
    height: .46rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .22s ease;
    margin-top: -.08rem;
}

.agenda-tree-node.is-collapsed > .agenda-tree-row .agenda-tree-toggle-icon {
    transform: rotate(-45deg);
    margin-top: .02rem;
}

.agenda-tree-stem {
    position: relative;
    width: 1.3rem;
    min-width: 1.3rem;
    display: flex;
    justify-content: center;
    padding-top: .25rem;
}

.agenda-tree-dot {
    width: .8rem;
    height: .8rem;
    border-radius: 999px;
    border: 2px solid #7ea7d8;
    background: #fff;
    box-shadow: 0 0 0 4px #f7fbff;
}

.agenda-tree-title-wrap {
    min-width: 0;
}

.agenda-tree-kicker {
    margin-bottom: .15rem;
    color: #7f93a6;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.agenda-tree-title {
    color: #172534;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
}

.agenda-tree-meta {
    margin-top: .2rem;
    color: #76899b;
    font-size: .82rem;
}

.agenda-tree-summary,
.agenda-tree-detail {
    color: #4d6277;
    font-size: .88rem;
    line-height: 1.5;
}

.agenda-tree-detail-item {
    color: #203245;
    font-weight: 600;
}

.agenda-tree-detail-sub {
    color: #7890a6;
    font-size: .81rem;
}

.agenda-tree-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.agenda-tree-children {
    position: relative;
    margin-left: 1.8rem;
}

.agenda-tree-children-wrap {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows .28s ease, opacity .22s ease;
}

.agenda-tree-children-inner {
    min-height: 0;
    overflow: hidden;
}

.agenda-tree-node.is-collapsed > .agenda-tree-children-wrap {
    grid-template-rows: 0fr;
    opacity: 0;
}

.agenda-tree-children::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: .9rem;
    left: 1.05rem;
    width: 1px;
    background: linear-gradient(180deg, #d6e0eb 0%, #e8eef5 100%);
}

.agenda-tree-node .agenda-tree-node .agenda-tree-row {
    padding-left: 1.75rem;
}

.agenda-tree-node .agenda-tree-node .agenda-tree-stem::before {
    content: "";
    position: absolute;
    top: 1rem;
    left: -1.05rem;
    width: 1.05rem;
    height: 1px;
    background: #d6e0eb;
}

.agenda-tree-node.is-day > .agenda-tree-row {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.agenda-tree-node.is-day > .agenda-tree-row .agenda-tree-dot {
    border-color: #2f7be8;
}

.agenda-tree-node.is-section > .agenda-tree-row .agenda-tree-dot {
    border-color: #4f97e5;
}

.agenda-tree-node.is-part > .agenda-tree-row .agenda-tree-dot {
    border-color: #6ca8d6;
}

.agenda-tree-node.is-session > .agenda-tree-row .agenda-tree-dot {
    border-color: #94aec8;
    width: .7rem;
    height: .7rem;
}

.agenda-tree-node.is-session > .agenda-tree-row {
    background: #fcfdff;
}

@media (max-width: 1199px) {
    .agenda-tree-head,
    .agenda-tree-row {
        grid-template-columns: minmax(20rem, 2.2fr) minmax(10rem, 1fr) minmax(10rem, .95fr) 7rem minmax(13rem, 1.15fr);
    }
}

@media (max-width: 991px) {
    .agenda-tree-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .agenda-tree-head {
        display: none;
    }

    .agenda-tree-row {
        grid-template-columns: 1fr;
        gap: .5rem;
        padding: 1rem 1rem 1rem 1.1rem;
    }

    .agenda-tree-actions {
        justify-content: flex-start;
    }

    .agenda-tree-summary::before,
    .agenda-tree-detail::before {
        display: block;
        margin-bottom: .1rem;
        color: #7f93a6;
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .agenda-tree-summary::before {
        content: "Summary";
    }

    .agenda-tree-detail::before {
        content: "Details";
    }
}

@media (max-width: 576px) {
    .agenda-tree-toolbar,
    .agenda-tree-filter,
    .agenda-tree-empty,
    .agenda-tree-shell {
        margin-left: 0;
        margin-right: 0;
    }

    .agenda-tree-toolbar,
    .agenda-tree-filter {
        padding-left: 0;
        padding-right: 0;
    }

    .agenda-tree-shell {
        border-radius: .85rem;
    }

    .agenda-tree-children {
        margin-left: .85rem;
    }

    .agenda-tree-children::before {
        left: .75rem;
    }

    .agenda-tree-node .agenda-tree-node .agenda-tree-stem::before {
        left: -.75rem;
        width: .75rem;
    }
}

/* =========================================================
   Icon Picker
   ========================================================= */

.ip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: .375rem;
    padding: .25rem;
}

.ip-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .5rem .25rem;
    background: #f8f9fa;
    border: 1.5px solid transparent;
    border-radius: .5rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    min-height: 64px;
    overflow: hidden;
}

.ip-icon-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.ip-icon-btn.ip-selected {
    background: #e8f0fe;
    border-color: var(--bs-primary);
}

.ip-icon-btn iconify-icon {
    color: #495057;
}

.ip-icon-btn .ip-icon-name {
    font-size: 0.65rem;
    line-height: 1.1;
    word-break: break-all;
    max-width: 100%;
    text-align: center;
    color: #6c757d;
}

.ip-icon-btn i {
    font-size: 1.25rem;
    color: #495057;
    pointer-events: none;
}

.ip-icon-btn.ip-selected i {
    color: var(--bs-primary);
}

.ip-icon-btn span {
    font-size: .65rem;
    color: #6c757d;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    pointer-events: none;
}

/* Trigger button trong form */
.icon-picker-trigger {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.icon-picker-trigger i {
    font-size: 1.1rem;
    min-width: 1.25rem;
    text-align: center;
}
