/* =========================================================================
   D127 Event Calendar — District 127 brand
   Blue #004165 (Loyal Blue) · Maroon #772432 (True Maroon) · Gold #f2df74
   Compact, small type by design.
   ========================================================================= */

/* ----------------------------------------------------------------- ADMIN */
.dec-wrap { max-width: 1200px; margin-right: 20px; font-size: 13px; }
.dec-wrap * { box-sizing: border-box; }

.dec-head { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap;
    background:#fff; border:1px solid #e2e4e7; border-radius:10px; padding:16px 20px; margin:16px 0 14px; }
.dec-head h1 { margin:0 0 3px; padding:0; font-size:20px; font-weight:600; line-height:1.3; }
.dec-head p { margin:0; color:#646970; font-size:12.5px; }
.dec-head-actions { display:flex; gap:8px; }

.dec-abtn { display:inline-flex; align-items:center; gap:6px; border:1px solid transparent; border-radius:6px;
    cursor:pointer; font-size:12.5px; font-weight:600; padding:7px 13px; text-decoration:none; line-height:1.4; }
.dec-abtn .dashicons { font-size:15px; width:15px; height:15px; }
.dec-abtn-blue { background:#004165; color:#fff; }
.dec-abtn-blue:hover { background:#005377; color:#fff; }
.dec-abtn-light { background:#f6f7f7; color:#1d2327; border-color:#dcdcde; }
.dec-abtn-light:hover { background:#eef0f1; color:#1d2327; }
.dec-abtn-danger { background:#772432; color:#fff; }
.dec-abtn-danger:hover { background:#5e1c27; color:#fff; }

.dec-danger { border-color:rgba(119,36,50,.35); border-top:3px solid #772432; }
.dec-danger .dec-h2 { color:#772432; }
.dec-danger a { color:#772432; }

.dec-facts { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.dec-fact { background:#fff; border:1px solid #e2e4e7; border-top:3px solid #004165; border-radius:8px;
    padding:8px 16px; font-size:11px; color:#646970; text-transform:uppercase; letter-spacing:.3px; }
.dec-fact span { display:block; font-size:19px; font-weight:700; color:#1d2327; line-height:1.2; letter-spacing:0; }

.dec-catlegend { display:flex; flex-wrap:wrap; gap:8px 14px; margin-bottom:14px; }
.dec-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#3c434a; font-weight:600; }
.dec-swatch { width:11px; height:11px; border-radius:3px; display:inline-block; }

.dec-card { background:#fff; border:1px solid #e2e4e7; border-radius:10px; padding:16px 18px; margin-bottom:14px; }
.dec-h2 { margin:0 0 8px; font-size:15px; font-weight:600; }
.dec-hint { color:#646970; font-size:12.5px; line-height:1.7; margin:0 0 14px; }
.dec-msg { border-radius:8px; padding:11px 15px; margin:14px 0; font-weight:600; font-size:13px; }
.dec-msg.is-ok  { background:#e6f4ea; color:#0a7c42; border:1px solid #b7e0c6; }
.dec-msg.is-err { background:rgba(119,36,50,.08); color:#772432; border:1px solid rgba(119,36,50,.3); }

.dec-table { width:100%; border-collapse:separate; border-spacing:0; }
.dec-table thead th { background:#004165; color:#fff; text-align:left; font-size:11px; font-weight:600;
    text-transform:uppercase; letter-spacing:.4px; padding:9px 10px; }
.dec-table thead th:first-child { border-top-left-radius:8px; }
.dec-table thead th:last-child { border-top-right-radius:8px; }
.dec-table tbody td { padding:9px 10px; border-bottom:1px solid #f0f0f1; font-size:12.5px; vertical-align:middle; }
.dec-table tbody tr:hover { background:rgba(0,65,101,.04); }
.dec-table tbody tr.is-past { opacity:.55; }
.dec-c-date { white-space:nowrap; font-weight:600; color:#1d2327; }
.dec-c-title strong { font-weight:600; }
.dec-na { color:#c3c4c7; }
.dec-tag { display:inline-block; color:#fff; border-radius:20px; padding:2px 9px; font-size:10.5px; font-weight:700;
    letter-spacing:.2px; white-space:nowrap; }
.dec-c-actions { white-space:nowrap; }
.dec-act { font-size:12px; font-weight:600; text-decoration:none; color:#004165; margin-right:8px; }
.dec-act:hover { text-decoration:underline; }
.dec-act-del { color:#772432; }

.dec-empty { text-align:center; padding:40px 20px; color:#646970; }
.dec-empty .dashicons { font-size:38px; width:38px; height:38px; color:#c3c4c7; }
.dec-empty h3 { margin:10px 0 4px; color:#1d2327; }

.dec-form .dec-fgrid, .dec-import-form .dec-fgrid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.dec-col-2 { grid-column:span 2; }
.dec-fgrid label { display:flex; flex-direction:column; gap:5px; font-size:11.5px; font-weight:700; color:#646970;
    text-transform:uppercase; letter-spacing:.3px; }
.dec-fgrid input[type=text], .dec-fgrid input[type=date], .dec-fgrid input[type=file], .dec-fgrid textarea {
    border:1px solid #dcdcde; border-radius:6px; padding:8px 10px; font-size:13px; text-transform:none;
    letter-spacing:0; font-weight:400; color:#1d2327; background:#fff; font-family:inherit; }
.dec-fgrid textarea { resize:vertical; }
.dec-fgrid input:focus, .dec-fgrid textarea:focus { border-color:#004165; box-shadow:0 0 0 1px #004165; outline:none; }
.dec-fgrid small { font-weight:400; text-transform:none; letter-spacing:0; color:#8a8f94; font-size:11px; }
.dec-check { flex-direction:row !important; align-items:center; gap:8px; text-transform:none !important;
    letter-spacing:0 !important; font-weight:500 !important; color:#3c434a !important; font-size:12.5px !important; }
.dec-form-actions { margin-top:16px; display:flex; gap:8px; }

@media (max-width:782px){ .dec-form .dec-fgrid, .dec-import-form .dec-fgrid { grid-template-columns:1fr; } .dec-col-2 { grid-column:span 1; } }


/* ------------------------------------------------------------- FRONTEND */
.dec-cal {
    --dec-blue:#004165; --dec-blue2:#005377; --dec-maroon:#772432; --dec-gold:#f2df74;
    --dec-ink:#2b3138; --dec-muted:#6a7178; --dec-line:#e6e8ea;
    font-family:'Montserrat',-apple-system,'Segoe UI',sans-serif;
    color:var(--dec-ink); font-size:13px; max-width:1080px; margin:0 auto;
    background:#fff; border:1px solid var(--dec-line); border-radius:12px; overflow:hidden;
}
.dec-cal * { box-sizing:border-box; }

.dec-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
    padding:14px 16px; background:linear-gradient(105deg,#0b2f49,var(--dec-blue2)); color:#fff; }
.dec-nav { display:flex; align-items:center; gap:8px; }
.dec-btn { background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.25);
    border-radius:6px; cursor:pointer; font:inherit; font-size:13px; font-weight:600; line-height:1;
    padding:7px 11px; transition:background .15s; }
.dec-btn:hover { background:rgba(255,255,255,.28); }
.dec-title { font-size:15px; font-weight:700; letter-spacing:.02em; margin-left:6px; }
.dec-viewswitch { display:flex; gap:4px; background:rgba(255,255,255,.12); border-radius:7px; padding:3px; }
.dec-vbtn { background:transparent; color:#fff; border:none; cursor:pointer; font:inherit; font-size:12px;
    font-weight:600; padding:6px 14px; border-radius:5px; }
.dec-vbtn.is-on { background:#fff; color:var(--dec-blue); }

.dec-legend { display:flex; flex-wrap:wrap; gap:6px 10px; padding:12px 16px; border-bottom:1px solid var(--dec-line);
    background:#fafbfc; }
.dec-lchip { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:#3c434a;
    cursor:pointer; user-select:none; padding:3px 9px; border-radius:20px; border:1px solid transparent; }
.dec-lchip .sw { width:10px; height:10px; border-radius:3px; }
.dec-lchip.is-off { opacity:.4; }
.dec-lchip:hover { border-color:var(--dec-line); }

.dec-body { padding:14px 16px 18px; }

/* Month grid */
.dec-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:var(--dec-line);
    border:1px solid var(--dec-line); border-radius:8px; overflow:hidden; }
.dec-dow { background:#f4f6f8; color:var(--dec-muted); font-size:10.5px; font-weight:700; text-transform:uppercase;
    letter-spacing:.4px; text-align:center; padding:8px 2px; }
.dec-cell { background:#fff; min-height:96px; padding:5px 6px; position:relative; }
.dec-cell.has-ev { cursor:pointer; }
.dec-cell.is-other { background:#fafbfc; }
.dec-cell.is-today { background:rgba(0,65,101,.06); }
.dec-daynum { font-size:11.5px; font-weight:700; color:#3c434a; }
.dec-cell.is-other .dec-daynum { color:#c3c4c7; }
.dec-cell.is-today .dec-daynum { background:var(--dec-blue); color:#fff; border-radius:50%;
    width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; font-size:11px; }
.dec-evs { margin-top:4px; display:flex; flex-direction:column; gap:3px; }
.dec-ev { display:block; width:100%; text-align:left; border:none; cursor:pointer; color:#fff;
    border-radius:4px; padding:3px 6px; font-size:11px; font-weight:600; line-height:1.25;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-family:inherit; }
.dec-ev:hover { filter:brightness(1.08); }
.dec-more { font-size:10.5px; font-weight:700; color:var(--dec-muted); cursor:pointer; padding:1px 4px; background:none; border:none; }
.dec-more:hover { color:var(--dec-blue); }

/* Agenda */
.dec-agenda-list { display:flex; flex-direction:column; }
.dec-ag-month { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--dec-blue);
    margin:16px 0 8px; padding-bottom:5px; border-bottom:2px solid var(--dec-line); }
.dec-ag-month:first-child { margin-top:0; }
.dec-ag-row { display:flex; gap:14px; padding:10px 4px; border-bottom:1px solid #f1f3f4; }
.dec-ag-row:hover { background:rgba(0,65,101,.03); }
.dec-ag-date { flex:0 0 52px; text-align:center; }
.dec-ag-d { font-size:20px; font-weight:800; color:var(--dec-ink); line-height:1; }
.dec-ag-dow { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--dec-muted); }
.dec-ag-bar { flex:0 0 3px; border-radius:3px; align-self:stretch; }
.dec-ag-main { flex:1 1 auto; min-width:0; }
.dec-ag-title { font-size:13.5px; font-weight:700; color:var(--dec-ink); }
.dec-ag-meta { font-size:11.5px; color:var(--dec-muted); margin-top:2px; }
.dec-ag-tag { display:inline-block; color:#fff; border-radius:20px; padding:1px 8px; font-size:10px; font-weight:700; margin-left:6px; }
.dec-empty-note { text-align:center; color:var(--dec-muted); padding:34px 10px; font-size:13px; }

/* Detail popover — a FIXED modal centred on the viewport, so it always appears
   in the middle of the screen no matter how far down the agenda you've scrolled. */
.dec-cal { position:relative; }
.dec-pop { position:fixed; z-index:100000; top:50%; left:50%; transform:translate(-50%,-50%);
    width:min(380px,92vw); max-height:82vh; overflow:auto;
    background:#fff; border:1px solid var(--dec-line); border-radius:14px;
    box-shadow:0 20px 60px rgba(0,0,0,.32); padding:22px 24px; }
.dec-pop[hidden] { display:none; }
.dec-pop-close { position:absolute; top:10px; right:12px; background:none; border:none; font-size:24px;
    line-height:1; color:var(--dec-muted); cursor:pointer; padding:4px 8px; }
.dec-pop-close:hover { color:var(--dec-maroon); }
.dec-pop-cat { display:inline-block; color:#fff; border-radius:20px; padding:3px 11px; font-size:10.5px;
    font-weight:700; text-transform:uppercase; letter-spacing:.3px; margin-bottom:10px; }
.dec-pop-title { font-size:17px; font-weight:800; color:var(--dec-ink); line-height:1.25; margin-bottom:10px; padding-right:24px; }
.dec-pop-desc { font-size:13px; line-height:1.6; color:#3c434a; margin:0 0 14px; padding-bottom:12px; border-bottom:1px solid var(--dec-line); }
.dec-pop-row { display:flex; gap:8px; font-size:13px; color:#3c434a; margin-bottom:6px; }
.dec-pop-row .k { flex:0 0 74px; color:var(--dec-muted); font-weight:600; }
.dec-pop-backdrop { position:fixed; inset:0; background:rgba(15,30,45,.45); z-index:99999; }
.dec-pop-backdrop[hidden] { display:none; }

/* On small screens, slide up from the bottom as a sheet — easier to reach. */
@media (max-width:640px){
    .dec-pop { top:auto; bottom:0; left:0; transform:none;
        width:100%; max-width:100%; max-height:78vh;
        border-radius:16px 16px 0 0; padding:22px 20px 26px; }
}

/* Tap hint sits inside the month view, so it only appears there. Hidden on desktop. */
.dec-taphint { display:none; font-size:11px; color:var(--dec-muted); text-align:center; margin-bottom:8px; }

@media (max-width:640px){
    .dec-cell { min-height:52px; padding:4px 3px; }   /* taller = easier to tap */
    .dec-evs { display:none; }                        /* dots-only on phones to keep the grid usable */
    .dec-cell.has-ev::after { content:''; position:absolute; bottom:6px; left:50%; transform:translateX(-50%);
        width:7px; height:7px; border-radius:50%; background:var(--dec-blue); }
    .dec-cell.has-ev:active { background:rgba(0,65,101,.10); }   /* tap feedback */
    .dec-title { font-size:13px; }
    .dec-toolbar { padding:12px; }
    .dec-taphint { display:block; }
}
