/**
 * APMTMVII App CSS v3 — "Dock Worker Modern"
 * @version 3.0
 */

/* ===== BODY SPACING ===== */
body.has-navbar { padding-top: 3.25rem; }
body.has-navbar.has-tabs { padding-top: 6.5rem; }
body.has-bottomnav { padding-bottom: 4rem; }
@media(min-width:1024px) { body.has-bottomnav { padding-bottom: 0; } }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--navy);
}
.navbar-top {
  display: flex; align-items: center; justify-content: space-between;
  height: 3.25rem; padding: 0 1rem; max-width: 1200px; margin: 0 auto;
}
.navbar-brand { display: flex; align-items: center; gap: 0.5rem; color: #E2E8F0; text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.navbar-brand:hover { color: #fff; text-decoration: none; }
.navbar-brand img { width: 28px; height: 28px; }
.navbar-links { display: none; align-items: center; gap: 0.25rem; }
@media(min-width:1024px) { .navbar-links { display: flex; } }
.navbar-links a { color: #8DA9C4; font-size: 0.8125rem; padding: 0.375rem 0.625rem; border-radius: var(--r); text-decoration: none; transition: color var(--ease); }
.navbar-links a:hover { color: #E2E8F0; }
.navbar-actions { display: flex; align-items: center; gap: 0.25rem; }
.navbar-btn { background: none; border: none; cursor: pointer; color: #8DA9C4; padding: 0.5rem; border-radius: var(--r); font-size: 1rem; position: relative; transition: color var(--ease); text-decoration: none; }
.navbar-btn:hover { color: #E2E8F0; text-decoration: none; }
[data-theme="dark"] .navbar-btn { color: #8DA9C4; }
[data-theme="dark"] .navbar-btn:hover { color: #E2E8F0; }
.notif-count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; background: var(--accent); border-radius: var(--r-full); font-size: 0.5625rem; font-weight: 600; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* ===== SHIFT TABS ===== */
.shift-tabs { display: flex; justify-content: center; background: var(--navy-light); }
.shift-tab { display: block; padding: 0.625rem 1.25rem; color: #8DA9C4; font-size: 0.8125rem; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; transition: all var(--ease); }
.shift-tab:hover { color: #E2E8F0; text-decoration: none; }
.shift-tab.active { color: #FFFFFF; border-bottom-color: var(--accent); font-weight: 600; }
.shift-tab.disabled { opacity: 0.25; pointer-events: none; }

/* ===== DROPDOWN PANEL ===== */
.dropdown-panel { position: absolute; right: 0; margin-top: 0.5rem; min-width: 14rem; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.dropdown-panel.notif-panel { min-width: 20rem; }

/* ===== BOTTOM NAV ===== */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--card); border-top: 1px solid var(--border); display: flex; height: 3.5rem; padding-bottom: env(safe-area-inset-bottom,0); }
@media(min-width:1024px) { .bottomnav { display: none; } }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text3); text-decoration: none; font-size: 0.625rem; font-weight: 500; transition: color var(--ease); }
.bottomnav a.active { color: var(--navy-mid); }
.bottomnav a:hover { color: var(--text2); text-decoration: none; }
.bottomnav a i { font-size: 1.125rem; }

/* ===== GROUP COLORS ===== */
.g-rco { background: #10B981; color: #fff; }
.g-ta { background: #F59E0B; color: #fff; }
.g-co { background: #06B6D4; color: #fff; }
.g-ato { background: #3B82F6; color: #fff; }
.g-pco { background: #6B7280; color: #fff; }
.g-sl { background: #8B5CF6; color: #fff; }
.g-fm { background: #64748B; color: #fff; }
.g-bbl { background: #F97316; color: #fff; }
/* Compat aliases */
.bg-rco { background: #10B981 !important; color: #fff; }
.bg-ta { background: #F59E0B !important; color: #fff; }
.bg-co { background: #06B6D4 !important; color: #fff; }
.bg-ato { background: #3B82F6 !important; color: #fff; }
.bg-pco { background: #6B7280 !important; color: #fff; }
.bg-sl { background: #8B5CF6 !important; color: #fff; }
.bg-fm { background: #64748B !important; color: #fff; }
.bg-bbl { background: #F97316 !important; color: #fff; }

/* ===== GROUP BADGE ===== */
.gbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; height: 1.5rem; padding: 0 0.5rem; font-size: 0.625rem; font-weight: 700; border-radius: 4px; letter-spacing: 0.02em; text-transform: uppercase; }

/* ===== FILTER PILLS ===== */
.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pill {
  display: inline-flex; align-items: center; height: 1.75rem; padding: 0 0.75rem;
  font: 500 0.75rem/1 var(--font); border-radius: var(--r-full);
  border: 1px solid var(--border); background: transparent; color: var(--text2);
  cursor: pointer; transition: all var(--ease); white-space: nowrap; text-decoration: none;
}
.pill:hover { border-color: var(--border2); color: var(--text); text-decoration: none; }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .pill.active { background: var(--accent); border-color: var(--accent); color: #0F172A; }

/* ===== USER LIST ===== */
.ulist { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.ulist-head { display: grid; grid-template-columns: 3.5rem 1fr 5rem; gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); background: var(--card-alt); border-bottom: 1px solid var(--border); }
.urow { display: grid; grid-template-columns: 3.5rem 1fr 5rem; gap: 0.5rem; padding: 0.75rem 1rem; align-items: center; border-top: 1px solid var(--border); transition: background var(--ease); }
.urow:first-child { border-top: none; }
.urow:hover { background: var(--card-alt); }
.urow.sick { opacity: 0.45; }
.urow .name { font-size: 0.875rem; color: var(--text); min-width: 0; }
.urow .name.me { color: var(--err); font-weight: 600; }
.urow .pts { font-size: 0.875rem; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; }
.sick-tag { display: inline-block; padding: 0 0.375rem; font-size: 0.5625rem; font-weight: 600; background: #FEF2F2; color: #991B1B; border-radius: 3px; margin-left: 0.375rem; vertical-align: middle; }
[data-theme="dark"] .sick-tag { background: #3B1010; color: #FCA5A5; }

/* Hidden toggles */
.addpoints { display: none; }
.sick-toggle { display: none; }

/* ===== FAB ===== */
.fab { position: fixed; bottom: 5rem; right: 1.5rem; width: 3.25rem; height: 3.25rem; border-radius: var(--r-full); background: var(--accent); color: #fff; border: none; font-size: 1.375rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 40; transition: all var(--ease); }
.fab:hover { background: var(--accent-hover); transform: scale(1.05); }
@media(min-width:1024px) { .fab { bottom: 2rem; } }

/* ===== MODAL ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; }
.modal-box { position: relative; z-index: 101; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 26rem; margin: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1rem; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.875rem 1rem; border-top: 1px solid var(--border); }

/* ===== FOOTER ===== */
.app-footer { padding: 1.5rem 1rem; text-align: center; color: var(--text3); font-size: 0.75rem; }
.donation-bar { position: relative; width: 100%; max-width: 16rem; height: 1.125rem; background: var(--border); border-radius: var(--r-full); overflow: hidden; margin: 0.5rem auto 0; }
.donation-bar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.625rem; font-weight: 600; }

/* ===== COOKIE ALERT ===== */
.cookie-alert { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; padding: 1rem; text-align: center; background: var(--card); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 0.8125rem; }

/* ===== ACP LAYOUT ===== */
.acp-wrap { max-width: none; margin: 0 -1rem; padding-top: 0; }
@media(min-width:640px) { .acp-wrap { max-width: 640px; margin: 0 auto; padding: 0 1rem; } }
@media(min-width:768px) { .acp-wrap { max-width: 768px; } }
@media(min-width:1024px) { .acp-wrap { max-width: 1024px; } }
@media(min-width:1280px) { .acp-wrap { max-width: 1280px; } }
@media(min-width:1536px) { .acp-wrap { max-width: 1536px; } }
.acp-layout { display: flex; flex-wrap: wrap; min-height: calc(100vh - 3.25rem); }
.acp-content { flex: 1; padding: 0 1rem 1.25rem; min-width: 0; }
@media(min-width:640px) { .acp-content { padding: 0 0 1.25rem 1.5rem; } }
.acp-content > h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

/* ===== ACP STAT CARDS ===== */
.acp-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
@media(min-width:768px) { .acp-stats { grid-template-columns: repeat(4, 1fr); } }
.acp-stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1rem; text-align: center; box-shadow: var(--shadow); }
.acp-stat-num { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.acp-stat-label { display: block; font-size: 0.6875rem; color: var(--text3); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.acp-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:768px) { .acp-grid-2 { grid-template-columns: 1fr 1fr; } }

/* ===== ACP SIDEBAR ===== */
.acp-sidebar { background: var(--card-alt); border-right: 1px solid var(--border); width: 14rem; flex-shrink: 0; }

/* ===== ACP DRAWER (mobile) ===== */
.acp-drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.acp-drawer.open { visibility: visible; }
.acp-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 200ms; }
.acp-drawer.open .acp-drawer-backdrop { opacity: 1; }
.acp-drawer-panel { position: absolute; top: 0; left: 0; bottom: 0; width: 16rem; background: var(--card); box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform 200ms ease; overflow-y: auto; }
.acp-drawer.open .acp-drawer-panel { transform: translateX(0); }
.acp-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.acp-nav { padding: 0.5rem 0; }
.acp-nav-link { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 1rem; font-size: 0.8125rem; color: var(--text2); text-decoration: none; transition: all var(--ease); border-left: 3px solid transparent; }
.acp-nav-link i { width: 1rem; text-align: center; font-size: 0.75rem; opacity: 0.6; flex-shrink: 0; }
.acp-nav-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.acp-nav-link.active { background: var(--bg); color: var(--navy-mid); font-weight: 600; border-left-color: var(--navy-mid); }
[data-theme="dark"] .acp-nav-link.active { color: var(--info); border-left-color: var(--info); background: var(--card); }
.acp-nav-link.active i { opacity: 1; }
.acp-section-label { padding: 0.625rem 1rem 0.25rem; font-size: 0.5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); margin-top: 0.25rem; }

/* ===== NEWS ===== */
.news-content img { max-width: 100%; height: auto; border-radius: var(--r); margin: 0.5rem 0; }
.news-content p { margin-bottom: 0.5rem; }
.news-content ul, .news-content ol { padding-left: 1.5rem; margin-bottom: 0.5rem; }
.news-content blockquote { border-left: 3px solid var(--border2); padding-left: 0.75rem; margin: 0.5rem 0; color: var(--text2); font-style: italic; }
.news-content code { background: var(--card-alt); padding: 0.125rem 0.375rem; border-radius: 3px; font-size: 0.8125rem; }
.news-content pre { background: var(--card-alt); padding: 0.75rem; border-radius: var(--r); overflow-x: auto; font-size: 0.8125rem; margin: 0.5rem 0; }

/* ===== BBCODE TOOLBAR ===== */
.bbcode-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: var(--r); overflow: visible; margin-bottom: 0.5rem; width: fit-content; }
.bbcode-toolbar button { display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; background: var(--card-alt); border: none; border-right: 1px solid var(--border); cursor: pointer; color: var(--text2); font-size: 0.6875rem; transition: all var(--ease); }
.bbcode-toolbar button:last-child { border-right: none; }
.bbcode-toolbar button:hover { background: var(--border); color: var(--text); }
.bbcode-sep { width: 1px; height: 1.125rem; background: var(--border2); margin: 0 2px; }

/* ===== NOTIFICATIONS ===== */
.notif-date-header { padding: 0.5rem 1rem; font-size: 0.6875rem; font-weight: 600; color: var(--text3); background: var(--card-alt); border-top: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.notif-date-header:first-child { border-top: none; }
.notif-row { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); transition: background var(--ease); }
.notif-row:hover { background: var(--card-alt); }
.notif-row.notif-unread { background: var(--card-alt); }
[data-theme="dark"] .notif-row.notif-unread { background: var(--card); }
.notif-icon { width: 1.5rem; text-align: center; flex-shrink: 0; padding-top: 0.125rem; font-size: 0.875rem; }
.notif-body { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.notif-link { color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 0.125rem; }
.notif-link:hover { text-decoration: none; }
.notif-subject { font-size: 0.8125rem; font-weight: 600; }
.notif-message { font-size: 0.8125rem; color: var(--text2); }
.notif-unread .notif-message { color: var(--text); }
.notif-time { font-size: 0.6875rem; color: var(--text3); }

/* ===== STATUS BADGES ===== */
.status-badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; font-size: 0.6875rem; font-weight: 600; border-radius: var(--r-full); }
.status-paid { background: var(--alert-success-bg); color: var(--alert-success-text); }
.status-unpaid { background: var(--alert-warning-bg); color: var(--alert-warning-text); }

/* ===== LOG TABLE ===== */
.log-table { width: 100%; }
.log-table th:first-child, .log-table .log-by { width: 20%; }
.log-table th:nth-child(2), .log-table .log-date { width: 20%; color: var(--text2); }
@media(max-width:639px) {
  .log-table thead { display: none; }
  .log-table .log-row { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.625rem 0.75rem; }
  .log-table .log-row td { padding: 0; width: auto !important; }
  .log-table .log-by { font-weight: 600; font-size: 0.75rem; }
  .log-table .log-date { font-size: 0.6875rem; color: var(--text3) !important; order: -1; }
  .log-table .log-action { font-size: 0.8125rem; }
}

/* ===== ROULATIE BORD ===== */
.rotate-my-bar { background: var(--accent); border-radius: var(--r); padding: 0.5rem 0.75rem; color: #fff; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.375rem; }
.rotate-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.rotate-legend-item { display: flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; color: var(--text3); }
.rotate-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.rotate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media(min-width:768px) { .rotate-grid { grid-template-columns: 1fr 1fr 1fr; } }

.rotate-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0.75rem; position: relative; overflow: hidden; transition: all var(--ease); }
.rotate-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.rotate-card.status-active::before { background: var(--ok); }
.rotate-card.status-relief::before { background: var(--info); }
.rotate-card.status-warning::before { background: var(--warn); }
.rotate-card.status-expired::before { background: var(--err); }
.rotate-card.status-idle::before { background: var(--text3); opacity: 0.3; }
.rotate-card.is-mine { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(249,115,22,0.15); }

.rotate-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.rotate-card-name { font-size: 0.875rem; font-weight: 700; color: var(--text); }
.rotate-type { font-size: 0.5625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 1px 5px; border-radius: 3px; }
.rotate-type-sqc { background: #DBEAFE; color: #1E40AF; }
.rotate-type-cc { background: #FEF3C7; color: #92400E; }
.rotate-type-rso { background: #D1FAE5; color: #065F46; }
.rotate-type-rcc { background: #EDE9FE; color: #5B21B6; }
[data-theme="dark"] .rotate-type-sqc { background: #1E3A5F; color: #93C5FD; }
[data-theme="dark"] .rotate-type-cc { background: #422006; color: #FCD34D; }
[data-theme="dark"] .rotate-type-rso { background: #064E3B; color: #6EE7B7; }
[data-theme="dark"] .rotate-type-rcc { background: #2E1065; color: #C4B5FD; }

.rotate-assigned { font-size: 0.6875rem; color: var(--accent); font-weight: 600; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.25rem; }
.rotate-assigned i { font-size: 0.5625rem; }
.rotate-me { color: var(--accent); font-weight: 700; }

.rotate-relief-info { font-size: 0.6875rem; color: var(--text2); margin-bottom: 0.125rem; display: flex; align-items: center; gap: 0.25rem; }
.rotate-relief-info i { font-size: 0.5625rem; color: var(--ok); }

.rotate-timer { font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; line-height: 1.2; }
.timer-active { color: var(--ok); }
.timer-relief { color: var(--info); }
.timer-warning { color: var(--warn); }
.timer-expired { color: var(--err); }

.rotate-idle-text { font-size: 0.75rem; color: var(--text3); padding: 0.75rem 0; text-align: center; opacity: 0.6; }

.rotate-relief-btn { width: 100%; }
.rotate-undo { width: 100%; font-size: 0.625rem; color: var(--text3); margin-top: 2px; }

.rotate-cc-btn { width: 100%; padding: 0.25rem; background: none; border: 1px dashed var(--border); border-radius: var(--r); font: 500 0.625rem var(--font); color: var(--text3); cursor: pointer; transition: all var(--ease); display: flex; align-items: center; justify-content: center; gap: 0.25rem; }
.rotate-cc-btn:hover { border-color: var(--warn); color: var(--warn); }

.rotate-assign { position: relative; }
.rotate-assign-btn { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 0.6875rem; padding: 0.25rem; border-radius: var(--r); transition: color var(--ease); }
.rotate-assign-btn:hover { color: var(--accent); }
.rotate-assign-panel { position: absolute; right: 0; top: 100%; z-index: 10; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 0.375rem; min-width: 10rem; }

/* ===== RESPONSIVE ===== */
@media(max-width:639px) { .hide-mobile { display: none !important; } }
@media(min-width:640px) { .hide-desktop { display: none !important; } }
@media(min-width:1024px) { .hide-lg { display: none !important; } }

/* Op mobiel: knoppen met .btn-label krimpen tot icoon-only en blijven vierkant.
   Touch target 40px. De actie-`<td>` in user-rows krijgt min-width:220px
   zodat 4 knoppen (Promote+Demote+Edit+Delete) op één regel passen — anders
   pakte de naam-kolom alle ruimte (zie acp_list_users_row.html). */
@media(max-width:639px) {
  .btn-sm .btn-label { display: none; }
  .btn-sm { min-width: 2.5rem; min-height: 2.5rem; padding: 0.375rem 0.5rem; font-size: 0.8125rem; }
}
