/* Shared pieces for the admin pages */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 1.5rem; padding: 18px 22px; background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color); border-radius: 12px; box-shadow: 0 2px 10px rgba(24, 97, 140, .05); }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head h4 { margin: 0; font-weight: 700; font-size: 1.3rem; }
.page-head p { margin: 4px 0 0; color: var(--bs-secondary-color); font-size: .9rem; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.page-head .actions .btn { white-space: nowrap; }
.page-head .picker { width: 300px; max-width: 100%; }

.stat-tile { background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color); border-radius: 12px; padding: 18px 20px; height: 100%; display: flex; align-items: center; gap: 16px; }
.stat-tile .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); flex-shrink: 0; }
.stat-tile .label { color: var(--bs-secondary-color); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }
.stat-tile .hint { font-size: .8rem; color: var(--bs-secondary-color); }
a.stat-tile { text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.stat-tile:hover { box-shadow: 0 6px 18px rgba(24, 97, 140, .12); transform: translateY(-1px); }

.meter { height: 12px; border-radius: 6px; background: var(--bs-secondary-bg); position: relative; overflow: visible; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--bs-primary); min-width: 2px; transition: width .4s; }
.meter .mark { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--bs-heading-color); }
.meter .mark::after { content: attr(data-label); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; white-space: nowrap; color: var(--bs-secondary-color); }

.day-row { display: grid; grid-template-columns: 150px 1fr 150px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bs-border-color); }
.day-row:last-child { border-bottom: 0; }
.day-row .name { font-weight: 600; }
.day-row .name small { display: block; font-weight: 400; color: var(--bs-secondary-color); }
.day-row .nums { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; }
.day-row.today .name::after { content: 'Today'; margin-left: 8px; font-size: .68rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--bs-primary); color: #fff; vertical-align: middle; }

.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--bs-border-color); }
.simple-list li:last-child { border-bottom: 0; }
.simple-list .grow { flex: 1; min-width: 0; }
.simple-list .title { font-weight: 600; color: var(--bs-heading-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simple-list .sub { font-size: .82rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--bs-secondary-color); }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: 8px; opacity: .6; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quick-links a { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--bs-border-color); border-radius: 10px; color: var(--bs-heading-color); font-weight: 600; font-size: .9rem; text-decoration: none; }
.quick-links a:hover { border-color: var(--bs-primary); color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.quick-links i { font-size: 1.4rem; color: var(--bs-primary); }

.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 220px; padding-top: 24px; border-bottom: 1px solid var(--bs-border-color); }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar-chart .bar { width: 100%; max-width: 72px; background: var(--bs-primary); border-radius: 4px 4px 0 0; position: relative; min-height: 3px; transition: opacity .15s; }
.bar-chart .bar:hover { opacity: .85; }
.bar-chart .bar span { position: absolute; top: -22px; left: -20px; right: -20px; text-align: center; font-size: .78rem; font-weight: 600; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }
.bar-labels { display: flex; gap: 2px; margin-top: 6px; }
.bar-labels div { flex: 1; text-align: center; font-size: .75rem; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 576px) {
  .day-row { grid-template-columns: 1fr; gap: 6px; }
  .day-row .nums { text-align: left; }
}

/* Template leftovers that ignore the brand colour */
.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle) {
  background: linear-gradient(270deg, rgba(24, 97, 140, .75) 0%, #18618c 100%) !important;
  box-shadow: 0 2px 6px rgba(24, 97, 140, .3) !important;
  color: #fff !important;
}
.swal2-styled.swal2-confirm:not([style*="background"]) { background-color: #18618c !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(24, 97, 140, .35) !important; }

/* ---------- Overall polish ---------- */
.layout-page .card { border: 1px solid var(--bs-border-color); border-radius: 12px; box-shadow: 0 2px 10px rgba(24, 97, 140, .05); }
.layout-page .card > .card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color); padding: 16px 22px; }
.layout-page .card > .card-header h5 { font-weight: 700; font-size: 1.05rem; }
.layout-page .card > .card-body { padding: 20px 22px; }
.layout-page .table > thead > tr > th { background: #f4f8fb; color: #44586b; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--bs-border-color); padding-top: 12px; padding-bottom: 12px; white-space: nowrap; }
.layout-page .table > tbody > tr:hover > td { background: #f8fbfd; }
.layout-page .table > :not(caption) > * > * { padding-left: 16px; padding-right: 16px; }
.layout-page .btn { border-radius: 8px; font-weight: 600; }
.layout-page .btn-sm { border-radius: 7px; }
.layout-page .form-control, .layout-page .form-select { border: 1.5px solid rgba(24, 97, 140, .28); border-radius: 8px; min-height: 38px; }
.layout-page .form-control:focus, .layout-page .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(24, 97, 140, .15); }
.layout-page .form-label { font-weight: 600; font-size: .85rem; color: #33475b; margin-bottom: 6px; }
.layout-page .badge { font-weight: 600; letter-spacing: .01em; }
.layout-page .dt-search input, .layout-page .dataTables_filter input { border: 1.5px solid rgba(24, 97, 140, .28); border-radius: 8px; min-height: 38px; padding: 4px 12px; }
.layout-page .dt-paging .page-link, .layout-page .dataTables_paginate .page-link { border-radius: 8px; margin: 0 2px; }
.layout-page .alert { border-radius: 10px; }

/* ---------- Modals: large, pinned near the top, plain header, action bar footer ---------- */
.modal-dialog { margin-top: 2.25rem; }
.modal-content { border: 1px solid #dfe6ec; border-radius: 14px; overflow: visible; box-shadow: 0 24px 60px rgba(15, 45, 66, .22); }
.modal-header { background: transparent; padding: 20px 26px 16px; border-bottom: 1px solid #e8edf2; align-items: center; border-radius: 14px 14px 0 0; }
.modal-header .modal-title { color: var(--bs-heading-color); font-weight: 700; font-size: 1.15rem; }
.modal-header .btn-close { position: static !important; inset: auto; align-self: center; margin: 0 0 0 auto !important; box-sizing: border-box; width: 32px !important; height: 32px !important; padding: 0 !important; border-radius: 8px; opacity: 1; transform: none !important; box-shadow: none; filter: none; mask: none; -webkit-mask: none;
  background: #f1f4f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2344586b' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 14px no-repeat !important; }
.modal-header .btn-close::before, .modal-header .btn-close::after { display: none !important; }
.modal-header .btn-close:hover { background-color: #e3e9ee !important; transform: none !important; }
.modal-body { padding: 22px 26px; position: relative; }
.modal-body .form-label, .modal-body label { font-weight: 600; font-size: .85rem; color: #33475b; margin-bottom: 6px; }
.modal-body .form-check-label { font-weight: 500; }
.modal-body .form-control, .modal-body .form-select { border: 1.5px solid rgba(24, 97, 140, .28); border-radius: 8px; min-height: 38px; }
.modal-body .form-control:focus, .modal-body .form-select:focus { border-color: #18618c; box-shadow: 0 0 0 3px rgba(24, 97, 140, .15); }
.modal-footer { background: transparent; border-top: 1px solid #e8edf2; padding: 16px 26px 18px !important; gap: 10px; justify-content: flex-end; border-radius: 0 0 14px 14px; }
.modal-footer > * { margin: 0; }
.modal-footer .btn { min-width: 112px; padding: .55rem 1.1rem; border-radius: 8px; font-weight: 600; }
.modal-footer .btn-secondary, .modal-footer .btn-outline-secondary, .modal-footer .btn-label-secondary { background: #fff; border: 1.5px solid #cfd8e0; color: #44586b; box-shadow: none; order: 1; }
.modal-footer .btn-secondary:hover, .modal-footer .btn-outline-secondary:hover { background: #f1f4f7; border-color: #b9c5d0; color: #1f2d3d; }
.modal-footer .btn-primary, .modal-footer .btn-success, .modal-footer .btn-danger, .modal-footer .btn-udom { order: 2; box-shadow: 0 4px 12px rgba(24, 97, 140, .25); }
.modal-backdrop.show { opacity: .5; }
.modal .section-title { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #18618c; margin: 4px 0 0; padding-bottom: 6px; border-bottom: 1px solid #e8edf2; }

/* ---------- Live board (inside the normal layout) ---------- */
.board-hero { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.board-hero .num { font-size: 4.6rem; font-weight: 800; line-height: .95; color: var(--bs-primary); font-variant-numeric: tabular-nums; }
.board-hero .of { color: var(--bs-secondary-color); font-size: 1.05rem; padding-bottom: 8px; }
.board-status { margin-left: auto; padding: 8px 16px; border-radius: 30px; font-weight: 700; background: var(--bs-warning-bg-subtle); color: #9a5b06; }
.board-status.ok { background: var(--bs-success-bg-subtle); color: #14683a; }
.board-meter { height: 18px; border-radius: 9px; margin: 34px 0 10px; }
.board-meter > span { border-radius: 9px; }
.arrival-list { list-style: none; margin: 0; padding: 0; }
.arrival-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bs-border-color); }
.arrival-list li:last-child { border-bottom: 0; }
.arrival-list li.new { animation: arrivalFlash 2.5s ease-out; }
@keyframes arrivalFlash { from { background: rgba(24, 97, 140, .18); } to { background: transparent; } }
.arrival-list .avatar-initial { width: 38px; height: 38px; border-radius: 50%; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.arrival-list .n { font-weight: 600; color: var(--bs-heading-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrival-list .m { color: var(--bs-secondary-color); font-size: .82rem; }
.arrival-list .t { margin-left: auto; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
#boardRoot:fullscreen { background: #f5f7fa; padding: 28px; overflow: auto; }
#boardRoot:fullscreen .board-hero .num { font-size: 7rem; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #28c76f; margin-right: 6px; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .35; transform: scale(.8); } }

/* ---------- Dashboard ---------- */
.dash-hero { position: relative; overflow: hidden; border-radius: 16px; padding: 28px 30px; color: #fff; background: linear-gradient(120deg, #0f4565 0%, #18618c 55%, #2a86bb 100%); box-shadow: 0 12px 30px rgba(24, 97, 140, .25); margin-bottom: 1.5rem; }
.dash-hero::before, .dash-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.dash-hero::before { width: 320px; height: 320px; right: -90px; top: -150px; }
.dash-hero::after { width: 200px; height: 200px; right: 150px; bottom: -130px; }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero .eyebrow { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.dash-hero h3 { color: #fff; font-weight: 700; margin: 6px 0 4px; font-size: 1.6rem; }
.dash-hero .sub { opacity: .88; margin: 0; }
.dash-hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dash-hero .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(255, 255, 255, .14); font-size: .84rem; font-weight: 500; }
.dash-hero .chip.accent { background: #f7941d; color: #2b1a00; font-weight: 700; }
.dash-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dash-hero .btn-light { color: #124a68; font-weight: 700; border: 0; }
.dash-hero .btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .5); background: transparent; font-weight: 600; }
.dash-hero .btn-ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.kpi { background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color); border-radius: 14px; padding: 20px; height: 100%; display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: box-shadow .15s, transform .15s; box-shadow: 0 2px 10px rgba(24, 97, 140, .05); }
a.kpi:hover { box-shadow: 0 10px 24px rgba(24, 97, 140, .14); transform: translateY(-2px); }
.kpi .top { display: flex; align-items: center; gap: 12px; }
.kpi .icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); flex-shrink: 0; }
.kpi .label { color: var(--bs-secondary-color); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .95rem; font-weight: 500; color: var(--bs-secondary-color); }
.kpi .foot { font-size: .82rem; color: var(--bs-secondary-color); margin-top: auto; }
.kpi .meter { height: 6px; }

.ring { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .track { fill: none; stroke: var(--bs-secondary-bg); stroke-width: 12; }
.ring .fill { fill: none; stroke: var(--bs-primary); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring .tick { fill: none; stroke: var(--bs-heading-color); stroke-width: 16; }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .center strong { font-size: 2.3rem; font-weight: 800; line-height: 1; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }
.ring .center span { font-size: .8rem; color: var(--bs-secondary-color); margin-top: 4px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 62px 14px 1fr; gap: 10px; padding-bottom: 16px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .time { font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--bs-heading-color); }
.timeline .time small { display: block; font-weight: 400; color: var(--bs-secondary-color); }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bs-primary); background: #fff; margin-top: 4px; position: relative; z-index: 1; }
.timeline li::before { content: ''; position: absolute; left: 77px; top: 16px; bottom: 0; width: 2px; background: var(--bs-border-color); }
.timeline li:last-child::before { display: none; }
.timeline li.live .dot { background: #f7941d; border-color: #f7941d; box-shadow: 0 0 0 4px rgba(247, 148, 29, .2); }
.timeline li.done { opacity: .55; }
.timeline .title { font-weight: 600; color: var(--bs-heading-color); }
.timeline .meta { font-size: .82rem; color: var(--bs-secondary-color); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bs-border-color); }
.activity li:last-child { border-bottom: 0; }
.activity .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity .what { font-size: .9rem; color: var(--bs-heading-color); }
.activity .when { font-size: .78rem; color: var(--bs-secondary-color); }
.quick-links { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.quick-links a { align-items: center; text-align: center; padding: 16px 10px; border-radius: 12px; transition: border-color .15s, background .15s, transform .15s; }
.quick-links a:hover { transform: translateY(-2px); }
.quick-links .qi { width: 44px; height: 44px; border-radius: 12px; background: var(--bs-primary-bg-subtle); display: flex; align-items: center; justify-content: center; }
.quick-links .qi i { font-size: 1.35rem; color: var(--bs-primary); }

.dash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 1.25rem; }
.dash-head h4 { margin: 0; font-weight: 800; font-size: 1.5rem; }
.dash-head p { margin: 2px 0 0; color: var(--bs-secondary-color); font-size: .9rem; }
.dash-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.meeting-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.meeting-chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: var(--bs-primary-bg-subtle); color: #124a68; font-size: .84rem; font-weight: 600; }
.meeting-chips .chip.accent { background: #fff0dc; color: #8a5200; }
.day-edit { grid-template-columns: minmax(0, 1fr) 190px 42px !important; gap: 10px !important; margin-bottom: 12px !important; }
@media (max-width: 480px) { .day-edit { grid-template-columns: 1fr 42px !important; } .day-edit .day-name { grid-column: 1 / -1; } }
