/*
 * Kriftel Intranet Portal – Main Stylesheet
 * Light/Dark theme with CSS custom properties
 * Default: Light — toggle via [data-theme="dark"] on <html>
 */

:root {
    /* ── Light Theme (Default) ── */
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #e2e8f0;
    --border: #cbd5e1;
    --border-light: #94a3b8;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --accent: #4f46e5;
    --accent-light: #4338ca;
    --accent-bg: rgba(79,70,229,0.08);
    --green: #16a34a;
    --green-bg: rgba(22,163,74,0.08);
    --amber: #d97706;
    --amber-bg: rgba(217,119,6,0.08);
    --red: #dc2626;
    --red-bg: rgba(220,38,38,0.08);
    --blue: #2563eb;
    --blue-bg: rgba(37,99,235,0.08);
    --cyan: #0891b2;
    --cyan-bg: rgba(8,145,178,0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --bg: #0a0e1a;
    --surface: #111827;
    --surface-2: #1a2236;
    --surface-3: #232d42;
    --border: #2a3550;
    --border-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-bg: rgba(99,102,241,0.12);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,0.12);
    --amber: #f59e0b;
    --amber-bg: rgba(245,158,11,0.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.12);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,0.12);
    --cyan: #06b6d4;
    --cyan-bg: rgba(6,182,212,0.12);
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg); color: var(--text);
    min-height: 100vh; overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.app-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 40px 1fr;
    min-height: 100vh;
}

/* ===== MINI BAR ===== */
.mini-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px; background: var(--surface);
    border-bottom: 1px solid var(--border); height: 40px;
}

/* ===== SIDEBAR (drawer, always hidden by default) ===== */
.sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0;
    width: 270px; z-index: 100;
    transition: left 0.3s ease;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar.open { left: 0; }
.sb-header {
    padding: 18px 16px 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sb-logo, .sb-logo-small {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: #fff; flex-shrink: 0;
}
.sb-logo { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
.sb-logo-small { width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.sb-brand h2 { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sb-brand span { font-size: 10.5px; color: var(--text-muted); }

.sb-section { padding: 14px 10px 2px; }
.sb-section-title {
    font-size: 9.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: var(--text-dim); padding: 0 8px 8px;
}
.sb-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    font-size: 13px; color: var(--text-muted); cursor: pointer;
    transition: all var(--transition);
}
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active { background: var(--accent-bg); color: var(--accent-light); font-weight: 600; }
.sb-item.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.sb-item .ic { width: 18px; text-align: center; font-size: 14px; }

.sb-badge {
    margin-left: auto; font-size: 9.5px; font-weight: 700;
    padding: 1px 6px; border-radius: 8px; min-width: 18px; text-align: center;
}
.sb-badge.dot { width: 7px; height: 7px; min-width: 7px; padding: 0; border-radius: 50%; }
.sb-badge.dot.green { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.sb-badge.accent { background: var(--accent); color: #fff; }
.sb-badge.amber { background: var(--amber); color: #000; }

.sb-user {
    margin-top: auto; padding: 14px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-info .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-info .role { font-size: 10.5px; color: var(--text-dim); }
.sb-user-info .tags { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }

.sb-tag {
    font-size: 8.5px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
}
.sb-tag.admin { background: var(--red-bg); color: var(--red); }
.sb-tag.role { background: var(--accent-bg); color: var(--accent-light); }
.sb-tag.dept { background: var(--green-bg); color: var(--green); }

/* ===== TOPBAR ===== */
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 20px; gap: 12px;
}
.public-topbar { position: sticky; top: 0; z-index: 100; }
.tb-breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.tb-breadcrumb .cur { color: var(--text); font-weight: 600; }
.tb-sep { color: var(--text-dim); margin: 0 3px; }
.tb-search-wrapper { margin-left: auto; position: relative; }
.tb-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-xs); padding: 7px 12px; width: 220px;
    color: var(--text-dim); font-size: 12px; cursor: pointer;
}
/* ===== GLOBAL SEARCH MODAL ===== */
.search-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 200;
}
.search-overlay.open { display: block; }
.search-modal {
    display: none; position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
    width: 580px; max-width: 90vw; z-index: 201;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 70vh; overflow: hidden;
}
.search-modal.open { display: block; }
.search-modal-inner { display: flex; flex-direction: column; max-height: 70vh; }
.search-input-row {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-input-row input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-size: 15px; font-family: inherit;
}
.search-input-row input::placeholder { color: var(--text-dim); }
.search-close {
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-dim); padding: 3px 8px; border-radius: 4px;
    font-size: 10px; cursor: pointer; font-family: inherit;
}
.search-results {
    overflow-y: auto; max-height: calc(70vh - 56px); padding: 8px;
}
.search-hint {
    text-align: center; color: var(--text-dim); font-size: 12px; padding: 24px;
}
.search-group-label {
    font-size: 10px; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 8px 8px 4px;
}
.search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.1s;
    text-decoration: none; color: var(--text);
}
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-item-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface-3); display: flex;
    align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.search-item-text { flex: 1; min-width: 0; }
.search-item-title {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-item-meta {
    font-size: 11px; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-no-results {
    text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px;
}
.tb-actions { display: flex; align-items: center; gap: 6px; }
.tb-icon {
    width: 34px; height: 34px; border-radius: 50%; background: transparent;
    border: 1px solid var(--border); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; transition: all var(--transition);
}
.tb-icon:hover { background: var(--surface-2); color: var(--text); }

/* Topbar logout button */
.tb-logout {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-xs);
    background: var(--red-bg); border: 1px solid rgba(239,68,68,0.2);
    color: var(--red); font-size: 12px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: all var(--transition);
}
.tb-logout:hover { background: rgba(239,68,68,0.2); border-color: var(--red); }

/* Sidebar logout icon button */
.sb-logout-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--red-bg); color: var(--red);
    font-size: 14px; text-decoration: none;
    transition: all var(--transition);
}
.sb-logout-btn:hover { background: rgba(239,68,68,0.25); }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    width: 34px; height: 34px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 24px; overflow-y: auto; background: var(--bg); }
.public-main { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ===== CARDS ===== */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 13px; font-weight: 700; }
.card-body { padding: 16px 20px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-accent { background: var(--accent-bg); color: var(--accent-light); }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px;
    transition: all var(--transition);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-val { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== GRIDS ===== */
.widget-area { margin-bottom: 24px; }
.widget-area-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.widget-area-header h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.widget-area-header .count {
    font-size: 11px; color: var(--text-dim);
    background: var(--surface-2); padding: 2px 8px; border-radius: 10px;
    font-weight: 500;
}
.widget-customize-btn {
    font-size: 11px; color: var(--accent-light); background: var(--accent-bg);
    border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-xs);
    padding: 5px 12px; cursor: pointer; font-weight: 500; font-family: inherit;
}
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 380px; gap: 14px; margin-bottom: 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 16px; }
.pub-grid { display: grid; grid-template-columns: 1fr 1fr 340px; gap: 16px; margin-bottom: 24px; }

/* ===== APP CARDS ===== */
.app-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 18px; cursor: pointer;
    transition: all var(--transition); position: relative; display: block;
}
.app-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card .app-icon {
    width: 44px; height: 44px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 12px;
}
.app-card h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.app-card p { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.app-card .app-dot {
    position: absolute; top: 12px; right: 12px;
    width: 8px; height: 8px; border-radius: 50%;
}
.app-card .app-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.app-card .app-dot.error { background: var(--red); }

.int-type {
    display: inline-flex; font-size: 9px; padding: 2px 6px; border-radius: 3px;
    font-weight: 600; margin-top: 8px;
}
.int-type.native { background: var(--green-bg); color: var(--green); }
.int-type.api { background: var(--blue-bg); color: var(--blue); }
.int-type.iframe { background: var(--amber-bg); color: var(--amber); }
.int-type.link { background: var(--surface-3); color: var(--text-dim); }

/* ===== FEED ===== */
.feed-list { display: flex; flex-direction: column; }
.feed-item {
    display: flex; gap: 10px; padding: 10px 16px;
    transition: background var(--transition);
}
.feed-item:hover { background: var(--surface-2); }
.feed-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.feed-title { font-size: 12px; font-weight: 500; line-height: 1.4; }
.feed-meta { font-size: 10px; color: var(--text-dim); margin-top: 1px; }

/* ===== QUICK ACTIONS ===== */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.qa-btn {
    display: flex; align-items: center; gap: 7px; padding: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-xs); color: var(--text);
    font-size: 11.5px; font-weight: 500; cursor: pointer;
    transition: all var(--transition); font-family: inherit;
}
.qa-btn:hover { background: var(--surface-3); border-color: var(--accent); }

/* ===== STATUS ===== */
.status-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; padding: 5px 10px; background: var(--surface-2);
    border-radius: var(--radius-xs);
}
.status-online { color: var(--green); font-weight: 600; }
.status-error { color: var(--red); font-weight: 600; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, rgba(99,102,241,0.08), transparent 70%);
}
.login-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 48px 44px; width: 440px;
    max-width: 92vw; box-shadow: 0 8px 40px rgba(0,0,0,0.4); text-align: center;
}
.login-logo-wrap {
    width: 80px; height: 80px; border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 36px; font-weight: 900; color: #fff;
}
.login-box h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.login-divider {
    display: flex; align-items: center; gap: 12px; margin: 24px 0;
    color: var(--text-dim); font-size: 12px;
}
.login-divider::before, .login-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.login-links { display: flex; flex-direction: column; gap: 8px; }
.login-links a { color: var(--accent-light); font-size: 13px; }
.login-links a:hover { text-decoration: underline; }
.login-footer { margin-top: 32px; font-size: 11px; color: var(--text-dim); line-height: 1.6; }

.sso-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 15px 24px; border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all var(--transition); font-family: inherit; text-decoration: none;
}
.sso-btn.primary { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; width: 100%; }
.sso-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.3); }
.sso-btn-small {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-xs);
    background: var(--accent); color: #fff; font-size: 12px;
    font-weight: 600; border: none; cursor: pointer; text-decoration: none;
}

/* ===== PUBLIC DASHBOARD ===== */
.pub-hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.05));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.time-display {
    font-size: 48px; font-weight: 900; letter-spacing: -2px;
    background: linear-gradient(135deg, var(--text), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1;
}
.date-display { font-size: 16px; color: var(--text-muted); margin-top: 4px; }
.greeting { font-size: 22px; font-weight: 700; margin-top: 16px; }
.greeting-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.info-ticker {
    background: var(--accent-bg); border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm); padding: 14px 20px;
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 13px;
}
.ticker-icon { font-size: 18px; }
.ticker-text { color: var(--accent-light); }

.login-prompt {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.04));
    border: 1px dashed var(--accent); border-radius: var(--radius-sm);
    padding: 24px; text-align: center;
}
.login-prompt h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.login-prompt p { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.lp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius-xs);
    background: var(--accent); color: #fff; font-size: 13px;
    font-weight: 600; text-decoration: none;
}

.quick-link { color: var(--accent-light); font-size: 13px; padding: 4px 0; display: block; }
.quick-link:hover { text-decoration: underline; }

/* Room status rows */
.room-status-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: var(--radius-xs); margin-bottom: 6px;
    border-left: 3px solid;
}
.room-red { background: var(--red-bg); border-color: var(--red); }
.room-amber { background: var(--amber-bg); border-color: var(--amber); }
.room-green { background: var(--green-bg); border-color: var(--green); }
.room-name { font-size: 12px; font-weight: 600; }

/* ===== DASHBOARD ===== */
.dash-greeting { margin-bottom: 20px; }
.dash-greeting h1 { font-size: 22px; font-weight: 800; }
.dash-greeting p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.widget-placeholder {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 32px; text-align: center; cursor: pointer;
    transition: all var(--transition); min-height: 120px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.widget-placeholder:hover { border-color: var(--accent); background: rgba(99,102,241,0.03); }
.wp-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.5; }
.wp-text { font-size: 12px; color: var(--text-dim); }

/* ===== ADMIN ===== */
.admin-tabs {
    display: flex; gap: 3px; margin-bottom: 20px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xs); padding: 3px; width: fit-content;
}
.admin-tab {
    padding: 7px 14px; border-radius: var(--radius-xs);
    font-size: 12px; cursor: pointer; color: var(--text-muted);
    transition: all var(--transition); border: none;
    background: transparent; font-family: inherit;
}
.admin-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-tab:hover:not(.active) { color: var(--text); background: var(--surface-2); }

.config-grid { display: flex; flex-direction: column; gap: 12px; }
.config-field label { font-size: 11px; color: var(--text-dim); display: block; margin-bottom: 4px; }
.config-value {
    padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-xs);
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; word-break: break-all;
}
.flow-steps { display: flex; flex-direction: column; gap: 8px; }
.flow-step {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    background: var(--surface-2); border-radius: var(--radius-xs);
    border-left: 3px solid var(--accent); font-size: 12px;
}
.flow-num {
    width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.flow-arrow { color: var(--text-dim); font-size: 14px; margin: 0 4px; }

/* OIDC Setup Guide */
.oidc-section-title { margin: 20px 0 10px; color: var(--text); font-size: 13px; }
.config-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.config-hint { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.config-copy { cursor: pointer; transition: background 0.2s; position: relative; }
.config-copy:hover { background: var(--surface-3); }
.config-copy.copied::after {
    content: 'Kopiert!'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--green); font-family: inherit;
}

.setup-step {
    padding: 16px; margin-bottom: 12px; background: var(--surface-2);
    border-radius: var(--radius-sm); border-left: 3px solid var(--accent);
}
.setup-step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.setup-step-header h4 { margin: 0; font-size: 13px; color: var(--text); }
.setup-step-num {
    width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.setup-step-path {
    font-size: 11px; color: var(--accent-light); margin-bottom: 10px;
    padding: 4px 8px; background: var(--accent-bg); border-radius: var(--radius-xs);
    display: inline-block;
}
.setup-sub-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 12px 0 6px; }
.setup-hint { font-size: 11px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }
.setup-hint code { font-size: 10px; background: var(--surface-3); padding: 1px 5px; border-radius: 3px; }

.setup-table {
    width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px;
}
.setup-table th {
    text-align: left; padding: 6px 10px; background: var(--surface-3);
    color: var(--text-dim); font-weight: 600; font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.setup-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    color: var(--text-muted); vertical-align: top;
}
.setup-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.setup-table code {
    font-size: 10px; background: var(--surface-3); padding: 1px 5px;
    border-radius: 3px; color: var(--accent-light);
}
.setup-table em { color: var(--text-dim); font-style: italic; }

.setup-code {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 12px 14px; margin: 8px 0 0; overflow-x: auto;
}
.setup-code code {
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px;
    color: var(--text-muted); line-height: 1.6; white-space: pre;
}

.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist-item {
    display: flex; align-items: flex-start; gap: 8px; font-size: 12px;
    color: var(--text-muted); cursor: pointer; padding: 4px 0;
}
.checklist-item input[type="checkbox"] {
    accent-color: var(--green); margin-top: 2px; flex-shrink: 0;
}
.checklist-item code { font-size: 10px; background: var(--surface-3); padding: 1px 5px; border-radius: 3px; }

.btn-sm { font-size: 11px; padding: 4px 10px; }

.grp-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--surface-2); border-radius: var(--radius-xs); font-size: 12px;
    margin-bottom: 6px;
}
.grp-name { flex: 1; font-weight: 600; }
.grp-count { font-size: 10px; color: var(--text-dim); background: var(--surface-3); padding: 1px 7px; border-radius: 8px; }

.user-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--surface-2); border-radius: var(--radius-xs); font-size: 12px;
    margin-bottom: 6px;
}
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-groups { display: flex; gap: 3px; flex-wrap: wrap; }

.perm-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.perm-table th {
    text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
    color: var(--text-muted); font-weight: 600; font-size: 10px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.perm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.perm-table tr:hover td { background: var(--surface-2); }
.perm-y { color: var(--green); font-weight: 700; }
.perm-n { color: var(--text-dim); }
.perm-c { color: var(--amber); font-weight: 600; }

.app-module-row {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: var(--surface-2); border-radius: var(--radius-xs); margin-bottom: 8px;
}
.app-module-icon { font-size: 24px; }
.app-module-info { flex: 1; }

/* ===== ERROR PAGE ===== */
.error-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.error-icon { font-size: 64px; margin-bottom: 16px; }
.error-page h1 { font-size: 24px; margin-bottom: 8px; }
.error-page p { color: var(--text-muted); margin-bottom: 4px; }

/* ===== FLASH MESSAGES ===== */
.flash { padding: 10px 16px; border-radius: var(--radius-xs); margin-bottom: 16px; font-size: 13px; }
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }

/* ===== UTILITY ===== */
.text-accent { color: var(--accent-light); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 11px; }
.bg-green { background: var(--green-bg); color: var(--green); }
.bg-blue { background: var(--blue-bg); color: var(--blue); }
.bg-amber { background: var(--amber-bg); color: var(--amber); }
.bg-red { background: var(--red-bg); color: var(--red); }
.bg-accent { background: var(--accent-bg); color: var(--accent-light); }
.bg-purple { background: rgba(139,92,246,0.12); color: #a78bfa; }

.loading-placeholder {
    text-align: center; padding: 20px; color: var(--text-dim); font-size: 12px;
}
.stat-placeholder {
    height: 60px; background: var(--surface-2); border-radius: var(--radius-xs);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Announcement items */
.announcement-item {
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.announcement-item:last-child { border-bottom: none; }
.announcement-title { font-weight: 600; font-size: 13px; }
.announcement-meta { font-size: 11px; color: var(--text-dim); margin: 2px 0 4px; }
.announcement-body { font-size: 12px; color: var(--text-muted); }

/* ===== PUBLIC DASHBOARD GRIDS ===== */
.pub-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.pub-grid-2 { display: grid; grid-template-columns: 1fr 380px; gap: 16px; margin-bottom: 24px; }

/* ===== HERO: Clock + Weather ===== */
.hero-top-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero-clock-section { display: flex; align-items: baseline; gap: 4px; }
.time-seconds {
    font-size: 22px; font-weight: 600; color: var(--accent-light);
    opacity: 0.6; margin-bottom: 6px;
}
.hero-weather-section { text-align: right; }
.weather-hero-inner {
    display: flex; align-items: center; gap: 12px;
}
.weather-hero-icon { font-size: 40px; }
.weather-hero-temp { font-size: 28px; font-weight: 800; line-height: 1; }
.weather-hero-desc { font-size: 13px; color: var(--text-muted); }

/* ===== WEATHER CARD ===== */
.weather-current { margin-bottom: 12px; }
.weather-main { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.weather-big-icon { font-size: 44px; }
.weather-temp { font-size: 32px; font-weight: 800; line-height: 1; }
.weather-desc { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.weather-details-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.wd-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; background: var(--surface-2);
    border-radius: var(--radius-xs); text-align: center;
}
.wd-label { font-size: 10px; color: var(--text-dim); }
.wd-val { font-size: 13px; font-weight: 700; }

.weather-forecast {
    display: flex; gap: 8px; padding-top: 12px;
    border-top: 1px solid var(--border);
}
.forecast-day {
    flex: 1; text-align: center; padding: 10px 6px;
    background: var(--surface-2); border-radius: var(--radius-xs);
}
.forecast-day.today { background: var(--accent-bg); border: 1px solid rgba(99,102,241,0.2); }
.fc-name { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.fc-icon { font-size: 24px; margin: 4px 0; }
.fc-temps { font-size: 12px; }
.fc-max { font-weight: 700; }
.fc-min { color: var(--text-dim); margin-left: 4px; }
.fc-rain { font-size: 10px; color: var(--blue); margin-top: 4px; }

/* ===== AUTH DASHBOARD: Hero ===== */
.dash-hero {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 20px; gap: 20px;
}
.dash-greeting h1 { font-size: 22px; font-weight: 800; }
.dash-greeting p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.dash-weather { flex-shrink: 0; }
.dash-weather-inner {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 18px;
}
.dw-icon { font-size: 28px; }
.dw-temp { font-size: 22px; font-weight: 800; }
.dw-desc { font-size: 12px; color: var(--text-muted); margin: 0 4px; }
.dw-detail { font-size: 11px; color: var(--text-dim); }

/* ===== EVENT ITEMS ===== */
.event-item {
    padding: 10px 12px; background: var(--surface-2);
    border-radius: var(--radius-xs); margin-bottom: 6px;
    border-left: 3px solid var(--accent);
}
.event-time { font-size: 11px; color: var(--accent-light); font-weight: 600; }
.event-title { font-size: 12.5px; font-weight: 600; margin: 2px 0; }
.event-location { font-size: 11px; color: var(--text-dim); }

/* Room status icon */
.room-icon { font-size: 10px; margin-right: 4px; }

/* Login prompt icon */
.lp-icon { font-size: 32px; margin-bottom: 8px; }

/* Loading small */
.loading-placeholder-sm { font-size: 12px; color: var(--text-dim); padding: 8px; }

/* Pinned announcement */
.announcement-item.pinned { background: var(--accent-bg); border-radius: var(--radius-xs); padding: 12px; }

/* ===== LOCAL LOGIN FORM ===== */
.local-login-toggle {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 12px; color: var(--text-dim); justify-content: center;
    margin-top: 16px; padding: 8px; user-select: none;
    transition: color var(--transition);
}
.local-login-toggle:hover { color: var(--text-muted); }
.local-login-toggle .arrow { transition: transform 0.2s; }
.local-login-toggle .arrow.open { transform: rotate(180deg); }
.local-login-form {
    margin-top: 12px; display: flex; flex-direction: column; gap: 10px;
    text-align: left;
}
.local-login-form label {
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    display: block; margin-bottom: 4px;
}
.local-login-form input {
    width: 100%; padding: 10px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    color: var(--text); font-size: 13px; font-family: inherit;
    transition: border-color var(--transition);
}
.local-login-form input:focus {
    outline: none; border-color: var(--accent);
}
.local-login-btn {
    width: 100%; padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-xs); background: var(--surface-2);
    color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: all var(--transition);
}
.local-login-btn:hover { background: var(--surface-3); border-color: var(--accent); }
.local-login-error {
    font-size: 12px; color: var(--red); background: var(--red-bg);
    padding: 8px 12px; border-radius: var(--radius-xs); display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .two-col { grid-template-columns: 1fr; }
    .pub-grid { grid-template-columns: 1fr 1fr; }
    .pub-grid-3 { grid-template-columns: 1fr 1fr; }
    .pub-grid-2 { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
}
/* Forms */
.form-input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
}
textarea.form-input { resize: vertical; }
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.btn {
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.btn:hover { background: var(--border); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { opacity: 0.9; }
.btn-danger { background: var(--status-red); border-color: var(--status-red); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 3px 8px; font-size: 12px; }

/* Widget Cards */
.widget-card { transition: box-shadow 0.2s, opacity 0.2s; }
.widget-card.dragging { opacity: 0.4; }
.widget-drag-handle {
    cursor: grab;
    color: var(--text-dim);
    font-size: 14px;
    letter-spacing: -2px;
    user-select: none;
}
.widget-drag-handle:active { cursor: grabbing; }
.widget-small { grid-column: span 1; }
.widget-medium { grid-column: span 1; }
.widget-large { grid-column: span 2; }
.widget-full { grid-column: 1 / -1; }
.widget-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}
.widget-stat { text-align: center; }
.widget-stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}
.widget-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: capitalize;
    margin-top: 2px;
}
.widget-list { display: flex; flex-direction: column; gap: 8px; }
.widget-list-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.widget-list-item:last-child { border-bottom: none; }
.widget-list-title { font-size: 13px; color: var(--text); }
.widget-list-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Widget Assignment Rows (Admin) */
.widget-assign-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    font-size: 12px;
    transition: background 0.15s;
}
.widget-assign-row:hover { background: var(--surface-3); }
.widget-assign-row.dragging { opacity: 0.4; }

/* ===== CALENDAR: VIEW TOGGLE ===== */
.view-toggle {
    display: inline-flex; gap: 2px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-xs); padding: 2px; width: fit-content;
}
.view-toggle-btn {
    padding: 6px 16px; border-radius: var(--radius-xs);
    font-size: 12px; cursor: pointer; color: var(--text-muted);
    transition: all var(--transition); border: none;
    background: transparent; font-family: inherit; font-weight: 500;
}
.view-toggle-btn.active {
    background: var(--accent); color: #fff; font-weight: 600;
}
.view-toggle-btn:hover:not(.active) {
    color: var(--text); background: var(--surface-2);
}

/* ===== CALENDAR: ROOM FILTER PILLS ===== */
.room-filter-row {
    display: flex; gap: 5px; flex-wrap: wrap;
}
.room-pill {
    padding: 4px 10px; border-radius: 16px; font-size: 10px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim); transition: all 0.15s;
}
.room-pill.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.room-pill:hover { border-color: var(--border-light); }

/* ===== CALENDAR: MONTH VIEW ===== */
.month-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
}
.month-grid .mg-header {
    padding: 10px 4px; text-align: center;
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.month-grid .mg-cell {
    min-height: 100px; padding: 6px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.15s;
    position: relative;
}
.month-grid .mg-cell:nth-child(7n) { border-right: none; }
.month-grid .mg-cell:hover { background: var(--surface-2); }
.month-grid .mg-cell.outside {
    background: var(--surface-3); opacity: 0.4;
}
.month-grid .mg-cell.is-today {
    background: var(--accent-bg);
}
.month-grid .mg-cell.is-today .mg-day-num {
    background: var(--accent); color: #fff;
    border-radius: 50%; width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
}
.mg-day-num {
    font-size: 13px; font-weight: 700; color: var(--text);
    margin-bottom: 4px; display: inline-block;
}
.mg-event-pill {
    display: block; padding: 2px 6px; margin-bottom: 2px;
    border-radius: 4px; font-size: 10px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.5; border-left: 3px solid var(--accent);
}
.mg-event-pill.status-synced { border-left-color: var(--green); background: var(--green-bg); color: var(--green); }
.mg-event-pill.status-pending { border-left-color: var(--amber); background: var(--amber-bg); color: var(--amber); }
.mg-event-pill.status-ignored { border-left-color: var(--text-dim); background: var(--surface-3); color: var(--text-dim); }
.mg-event-pill.status-new { border-left-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.mg-more-link {
    font-size: 10px; color: var(--accent-light); cursor: pointer;
    padding: 1px 6px; font-weight: 600;
}
.mg-more-link:hover { text-decoration: underline; }
.mg-badge {
    display: none; /* shown only on mobile */
}

/* ===== CALENDAR: DAY VIEW ===== */
.day-timeline {
    display: grid; position: relative;
    min-height: 600px;
}
.day-timeline-header {
    display: contents;
}
.dt-corner {
    background: var(--surface-2); border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 10px 8px; font-size: 11px; font-weight: 600;
    color: var(--text-dim); text-align: center;
    position: sticky; top: 0; z-index: 2;
}
.dt-room-header {
    background: var(--surface-2); border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 10px 8px; font-size: 11px; font-weight: 600;
    color: var(--text-muted); text-align: center;
    position: sticky; top: 0; z-index: 2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dt-room-header:last-child { border-right: none; }
.dt-time-label {
    padding: 0 8px; font-size: 10px; color: var(--text-dim);
    text-align: right; border-right: 1px solid var(--border);
    position: relative; height: 60px;
    display: flex; align-items: flex-start; justify-content: flex-end;
    padding-top: 2px;
}
.dt-room-col {
    position: relative; border-right: 1px solid var(--border);
    height: 60px; border-bottom: 1px solid var(--border);
}
.dt-room-col:last-child { border-right: none; }
.dt-event-block {
    position: absolute; left: 2px; right: 2px;
    border-radius: 5px; padding: 4px 6px;
    font-size: 10px; overflow: hidden; z-index: 1;
    cursor: default; border-left: 3px solid var(--accent);
    line-height: 1.3; min-height: 20px;
}
.dt-event-block .dt-ev-title {
    font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dt-event-block .dt-ev-customer {
    font-size: 9px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dt-event-block .dt-ev-time {
    font-size: 9px; color: var(--text-dim);
}
.dt-event-block.status-synced { border-left-color: var(--green); background: var(--green-bg); }
.dt-event-block.status-pending { border-left-color: var(--amber); background: var(--amber-bg); }
.dt-event-block.status-ignored { border-left-color: var(--text-dim); background: var(--surface-3); opacity: 0.6; }
.dt-event-block.status-new { border-left-color: var(--blue); background: var(--blue-bg); }

/* Day view mobile: single column */
.day-timeline-mobile {
    display: flex; flex-direction: column; gap: 2px;
}
.dtm-hour-row {
    display: flex; align-items: stretch; min-height: 28px;
}
.dtm-time {
    width: 50px; flex-shrink: 0; font-size: 10px; color: var(--text-dim);
    text-align: right; padding-right: 8px; padding-top: 2px;
    border-right: 1px solid var(--border);
}
.dtm-events {
    flex: 1; padding: 2px 6px; display: flex; flex-direction: column; gap: 2px;
}
.dtm-event {
    padding: 4px 8px; border-radius: 5px; font-size: 11px;
    border-left: 3px solid var(--accent);
}
.dtm-event.status-synced { border-left-color: var(--green); background: var(--green-bg); }
.dtm-event.status-pending { border-left-color: var(--amber); background: var(--amber-bg); }
.dtm-event.status-ignored { border-left-color: var(--text-dim); background: var(--surface-3); opacity: 0.6; }
.dtm-event.status-new { border-left-color: var(--blue); background: var(--blue-bg); }

/* ===== CALENDAR: STATUS LEGEND ===== */
.cal-legend {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 10px; color: var(--text-dim);
}
.cal-legend-item {
    display: flex; align-items: center; gap: 4px;
}
.cal-legend-dot {
    width: 10px; height: 10px; border-radius: 3px; border-left: 3px solid;
}
.cal-legend-dot.lg-synced { border-color: var(--green); background: var(--green-bg); }
.cal-legend-dot.lg-pending { border-color: var(--amber); background: var(--amber-bg); }
.cal-legend-dot.lg-ignored { border-color: var(--text-dim); background: var(--surface-3); }
.cal-legend-dot.lg-new { border-color: var(--blue); background: var(--blue-bg); }

/* ===== CALENDAR: BUILDING COLOR INDICATORS ===== */
.cal-event .ev-bldg, .mg-event-pill .pill-bldg,
.dt-event-block .dt-ev-bldg, .dtm-event .dtm-ev-bldg {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    margin-right: 3px; flex-shrink: 0; vertical-align: middle;
}
/* Building color legend items */
.cal-bldg-legend {
    display: flex; gap: 12px; flex-wrap: wrap;
    font-size: 10px; color: var(--text-dim); margin-top: 4px;
}
.cal-bldg-legend-item {
    display: flex; align-items: center; gap: 4px;
}
.cal-bldg-legend-dot {
    width: 8px; height: 8px; border-radius: 50%;
}

/* ===== CALENDAR: PRINT BUTTON ===== */
.cal-print-btn {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
    padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px;
    font-family: inherit; display: inline-flex; align-items: center; gap: 4px;
}
.cal-print-btn:hover { background: var(--surface-3); color: var(--text); }

/* ===== CALENDAR: PRINT LAYOUT ===== */
@media print {
    /* Hide non-essential UI */
    .sidebar, .sidebar-overlay, .topbar, .mini-bar, .hamburger,
    .cal-nav-btn, #view-toggle, .cal-print-btn, .today-btn,
    #building-filters, #room-filters, .cal-legend, .cal-bldg-legend,
    .sb-user, .tb-actions, .tb-search, .tb-search-wrapper, .tb-breadcrumb { display: none !important; }

    /* Full-width layout */
    .app-layout { display: block !important; }
    .main-content { padding: 0 !important; margin: 0 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; }

    /* Print header */
    .cal-print-header {
        display: block !important; text-align: center;
        margin-bottom: 12px; padding-bottom: 8px;
        border-bottom: 2px solid #333;
    }
    .cal-print-header h2 { font-size: 16pt; margin: 0 0 4px 0; color: #000; }
    .cal-print-header .print-subtitle { font-size: 10pt; color: #555; }

    /* Print footer */
    .cal-print-footer {
        display: block !important; margin-top: 16px; padding-top: 8px;
        border-top: 1px solid #999; font-size: 8pt; color: #666;
        text-align: right;
    }

    /* Force light colors for print */
    body, .main-content, .app-layout {
        background: #fff !important; color: #000 !important;
    }

    /* Week view print */
    .cal-grid-row { flex-wrap: nowrap !important; }
    .cal-day-col { page-break-inside: avoid; }
    .cal-day-header { background: #f0f0f0 !important; color: #000 !important; border-color: #999 !important; }
    .cal-day-header .day-num { color: #000 !important; }
    .cal-day-header.today { background: #e0e0ff !important; }
    .cal-event { background: #f5f5f5 !important; border-color: #999 !important; color: #000 !important; }
    .cal-event .ev-time, .cal-event .ev-title, .cal-event .ev-room { color: #000 !important; }
    .cal-event.status-synced { border-left-color: #22c55e !important; }
    .cal-event.status-pending { border-left-color: #f59e0b !important; }
    .cal-event.status-new { border-left-color: #3b82f6 !important; }

    /* Month view print */
    .month-grid { border: 1px solid #999; }
    .mg-header { background: #eee !important; color: #000 !important; border-color: #999 !important; }
    .mg-cell { border-color: #999 !important; background: #fff !important; min-height: 60px !important; }
    .mg-cell.outside { background: #f5f5f5 !important; opacity: 0.5 !important; }
    .mg-cell.is-today { background: #e8f0fe !important; }
    .mg-day-num { color: #000 !important; }
    .mg-event-pill { display: block !important; background: #eee !important; color: #000 !important; border-left-color: #999 !important; }
    .mg-badge { display: none !important; }
    .mg-more-link { display: block !important; color: #333 !important; }

    /* Day view print */
    .day-timeline { min-height: auto !important; }
    .dt-corner, .dt-room-header { background: #eee !important; color: #000 !important; border-color: #999 !important; }
    .dt-time-label { color: #000 !important; border-color: #999 !important; }
    .dt-room-col { border-color: #ccc !important; }
    .dt-event-block { background: #f0f0f0 !important; border-color: #999 !important; color: #000 !important; }
    .dt-ev-title { color: #000 !important; }
    .dt-ev-customer, .dt-ev-time { color: #333 !important; }

    /* Print table (fallback for day/week) */
    .print-table {
        display: table !important; width: 100%; border-collapse: collapse;
        font-size: 9pt; margin-top: 8px;
    }
    .print-table th, .print-table td {
        border: 1px solid #999; padding: 4px 8px; text-align: left;
    }
    .print-table th { background: #eee; font-weight: 700; }
    .print-table tr:nth-child(even) { background: #f9f9f9; }
}

/* Print header/footer: hidden on screen */
.cal-print-header, .cal-print-footer { display: none; }

/* Hamburger button */
.hamburger {
    display: flex; background: none; border: none; cursor: pointer;
    padding: 8px; margin-right: 4px; flex-shrink: 0;
    flex-direction: column; justify-content: center;
}
.hamburger span {
    display: block; width: 20px; height: 2px;
    background: var(--text-muted); margin: 4px 0;
    border-radius: 1px; transition: var(--transition);
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* Sidebar search trigger */
.sb-search-trigger {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; margin: 8px 10px;
    border-radius: var(--radius-xs); font-size: 13px;
    color: var(--text-dim); background: var(--surface-2);
    border: 1px solid var(--border); cursor: pointer;
    transition: all var(--transition);
}
.sb-search-trigger:hover {
    background: var(--surface-3); color: var(--text);
}
.sb-search-trigger .shortcut {
    margin-left: auto; font-size: 10px; opacity: 0.4;
}

/* Sidebar footer actions (theme toggle, etc.) */
.sb-footer-actions {
    padding: 8px 10px; border-top: 1px solid var(--border);
}
.sb-footer-actions .sb-action-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    font-size: 13px; color: var(--text-muted);
    background: none; border: none; cursor: pointer;
    width: 100%; text-align: left; font-family: inherit;
    transition: all var(--transition);
}
.sb-footer-actions .sb-action-item:hover {
    background: var(--surface-2); color: var(--text);
}

/* Topbar hidden (replaced by mini-bar) */
.topbar { display: none; }

/* Fullscreen content modifier */
.main-content--fullscreen { padding: 0 !important; }

@media (max-width: 768px) {
    .pub-grid { grid-template-columns: 1fr; }
    .pub-grid-3 { grid-template-columns: 1fr; }
    .pub-grid-2 { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .hero-top-row { flex-direction: column; gap: 16px; }
    .hero-weather-section { text-align: left; }
    .dash-hero { flex-direction: column; }
    .weather-forecast { flex-direction: column; }

    /* Touch targets: min 44px */
    .sb-item { min-height: 44px; padding: 10px 14px; }
    .btn { min-height: 44px; padding: 10px 16px; }
    .filter-pill { min-height: 40px; padding: 8px 14px; }

    /* Widget grid: single column */
    .widget-grid { grid-template-columns: 1fr !important; }
    .app-grid { grid-template-columns: 1fr !important; }

    /* Calendar responsive */
    .month-grid .mg-cell { min-height: 48px; padding: 4px; }
    .mg-event-pill { display: none; }
    .mg-more-link { display: none; }
    .mg-badge {
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--accent-bg); color: var(--accent-light);
        font-size: 9px; font-weight: 700;
        width: 18px; height: 18px; border-radius: 50%;
        margin-top: 2px;
    }
    .mg-day-num { font-size: 11px; }
    .view-toggle-btn { padding: 5px 10px; font-size: 11px; }
}
