/* ============================================================
   Maestro Obras — design system
   Tema escuro inspirado no dashboard de referência.
   Responsivo para tablets e celulares.
   ============================================================ */

:root {
    --bg: #16181d;
    --bg-2: #1d2026;
    --panel: #21242b;
    --panel-2: #282c34;
    --panel-3: #2f343d;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .12);
    --text: #eef0f3;
    --muted: #9aa1ad;
    --muted-2: #6c727d;
    --accent: #e8eaed;
    --accent-ink: #16181d;
    --brand: #5b8cff;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #f87171;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, .25);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
input, select, textarea, button { font-family: inherit; }

/* ----- Boot loader ----- */
.boot-loader { position: fixed; inset: 0; display: grid; place-content: center; gap: 22px; justify-items: center; }
.boot-mark { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, #2f343d, #21242b); display: grid; place-content: center; box-shadow: var(--shadow); }
.boot-mark i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: block; }
.boot-bar { width: 160px; height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 4px; animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

/* ============================================================
   App shell
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    width: 244px;
    flex-shrink: 0;
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--panel-3), var(--panel)); display: grid; place-content: center; font-size: 20px; color: var(--accent); box-shadow: var(--shadow-soft); }
.brand-mark.big { width: 64px; height: 64px; border-radius: 20px; font-size: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title { font-weight: 800; font-size: 16px; }
.brand-sub { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted-2); }

.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 12px 8px; margin-bottom: 6px; border-radius: var(--radius-sm); background: var(--panel); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #8a6cff); color: #fff; display: grid; place-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 500; font-size: 14px;
    transition: all .2s var(--ease); position: relative;
}
.sidebar-nav .nav-link i { font-size: 18px; }
.sidebar-nav .nav-link:hover { background: var(--panel); color: var(--text); }
.sidebar-nav .nav-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.badge-count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.nav-link.active .badge-count { background: var(--accent-ink); color: var(--accent); }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.conn-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--panel); }
.conn-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-pill.online .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.conn-pill.offline .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.btn-logout { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s var(--ease); }
.btn-logout:hover { background: rgba(248, 113, 113, .12); color: var(--red); }

.drawer-backdrop { display: none; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 26px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: rgba(22, 24, 29, .82);
    backdrop-filter: blur(12px); z-index: 30;
}
.hamburger { display: none; background: var(--panel); border: none; color: var(--text); width: 40px; height: 40px; border-radius: 11px; font-size: 20px; cursor: pointer; }
.topbar-title { font-weight: 600; font-size: 14px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.topbar-actions { margin-left: auto; }
.conn-pill.compact { padding: 6px 12px; }

.content-area { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; flex: 1; }

/* ============================================================
   Common
   ============================================================ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title { font-size: 26px; }
.page-subtitle { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.section-title { font-size: 16px; margin: 30px 0 14px; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }

.btn-accent {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    background: var(--accent); color: var(--accent-ink);
    border: none; border-radius: 12px; padding: 12px 18px;
    font-weight: 600; font-size: 14px; cursor: pointer;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), opacity .2s;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.btn-accent:active { transform: translateY(0); }
.btn-accent:disabled { opacity: .6; cursor: default; transform: none; }
.btn-accent.full { width: 100%; }

.btn-ghost { background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 17px; display: inline-grid; place-content: center; transition: all .2s var(--ease); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-back { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; margin-bottom: 16px; transition: color .2s, gap .2s var(--ease); }
.btn-back:hover { color: var(--text); gap: 12px; }
.btn-danger-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; transition: all .2s; }
.btn-danger-ghost:hover { background: rgba(248, 113, 113, .12); color: var(--red); border-color: transparent; }

.search-bar { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px 16px; margin-bottom: 22px; transition: border-color .2s; }
.search-bar:focus-within { border-color: var(--line-strong); }
.search-bar i { color: var(--muted); font-size: 16px; }
.search-bar input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 15px; }
.search-bar input::placeholder { color: var(--muted-2); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state.small { padding: 36px 20px; }
.empty-state i { font-size: 38px; color: var(--muted-2); display: block; margin-bottom: 12px; }
.empty-state p { margin: 0; font-size: 14px; }

.loader-center { display: grid; place-content: center; padding: 80px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); border-top-color: currentColor; display: inline-block; animation: spin .7s linear infinite; }
.spinner.big { width: 34px; height: 34px; border-width: 3px; border-color: var(--panel-2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; display: inline-block; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.chip-offline { background: rgba(52, 211, 153, .15); color: var(--green); }
.chip-pending { background: rgba(251, 191, 36, .15); color: var(--amber); }

/* ============================================================
   Empreendimentos grid
   ============================================================ */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.emp-card {
    text-align: left; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; cursor: pointer; color: var(--text);
    display: flex; flex-direction: column; gap: 14px;
    transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.emp-card:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--panel-2); }
.emp-card-top { display: flex; align-items: center; justify-content: space-between; }
.emp-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--panel-3); display: grid; place-content: center; font-size: 21px; color: var(--accent); }
.emp-card-body h3 { font-size: 16.5px; margin-bottom: 6px; }
.emp-loc { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.emp-call { color: var(--muted-2); font-size: 12.5px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.emp-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.emp-go { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: gap .2s var(--ease); }
.emp-card:hover .emp-go { gap: 10px; }

.skeleton-card { height: 168px; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Empreendimento header + offline banner
   ============================================================ */
.emp-header { margin-bottom: 18px; }
.offline-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 22px; transition: border-color .3s;
}
.offline-banner.ready { border-color: rgba(52, 211, 153, .35); background: linear-gradient(180deg, rgba(52, 211, 153, .06), var(--panel)); }
.ob-info { display: flex; align-items: center; gap: 14px; }
.ob-info > i { font-size: 26px; color: var(--accent); }
.offline-banner.ready .ob-info > i { color: var(--green); }
.ob-info strong { display: block; font-size: 14.5px; }
.ob-info span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; max-width: 460px; }
.ob-actions { display: flex; align-items: center; gap: 12px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); user-select: none; }
.switch input { display: none; }
.slider { width: 42px; height: 24px; border-radius: 20px; background: var(--panel-3); position: relative; transition: background .25s var(--ease); }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:checked ~ .switch-label { color: var(--green); }

/* ============================================================
   Imóvel list
   ============================================================ */
.imovel-list { display: flex; flex-direction: column; gap: 10px; }
.imovel-card {
    display: flex; align-items: center; gap: 14px; text-align: left;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; cursor: pointer; color: var(--text);
    transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.imovel-card:hover { transform: translateX(3px); background: var(--panel-2); border-color: var(--line-strong); }
.imovel-thumb { width: 56px; height: 56px; border-radius: 11px; background: var(--panel-3); flex-shrink: 0; display: grid; place-content: center; font-size: 22px; color: var(--muted); overflow: hidden; }
.imovel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.imovel-body { flex: 1; min-width: 0; }
.imovel-title { font-weight: 600; font-size: 14.5px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imovel-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.imovel-meta span { display: inline-flex; align-items: center; gap: 5px; }
.imovel-arrow { color: var(--muted-2); font-size: 18px; flex-shrink: 0; }

/* ============================================================
   Imóvel detail
   ============================================================ */
.imovel-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 20px; white-space: nowrap; }
.status-andamento { background: rgba(91, 140, 255, .16); color: #8fb0ff; }
.status-concluida { background: rgba(52, 211, 153, .16); color: var(--green); }
.status-paralisada { background: rgba(248, 113, 113, .16); color: var(--red); }
.status-naoiniciada { background: var(--panel-3); color: var(--muted); }

.tabs { display: flex; gap: 6px; background: var(--panel); padding: 5px; border-radius: 13px; margin-bottom: 20px; width: fit-content; max-width: 100%; }
.tab { flex: 1; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 9px 18px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s var(--ease); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: var(--accent-ink); }
.tab-count { background: rgba(0, 0, 0, .18); border-radius: 20px; padding: 0 7px; font-size: 11px; }
.tab.active .tab-count { background: rgba(0, 0, 0, .2); }

.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
    padding: 11px 13px; color: var(--text); font-size: 14px; outline: none; width: 100%;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, .15); }
.field textarea { resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%239aa1ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.progress-block { background: var(--bg-2); border-radius: 13px; padding: 16px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.progress-head strong { font-size: 22px; color: var(--text); }
.range { width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: var(--panel-3); outline: none; margin-bottom: 12px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.range::-moz-range-thumb { width: 20px; height: 20px; border: none; border-radius: 50%; background: var(--accent); cursor: pointer; }
.progress-track { height: 8px; border-radius: 8px; background: var(--panel-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--green)); transition: width .4s var(--ease); }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 4px; flex-wrap: wrap; }
.saved-flash { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================
   Fotos timeline
   ============================================================ */
.fotos-section { display: flex; flex-direction: column; gap: 18px; }
.upload-row { display: flex; align-items: center; gap: 10px; }
.upload-btn { position: relative; overflow: hidden; cursor: pointer; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.timeline { position: relative; padding: 8px 0 4px; }
.timeline-line { position: absolute; top: 92px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--line-strong) 6%, var(--line-strong) 94%, transparent); }
.timeline-track { display: flex; gap: 18px; overflow-x: auto; padding: 0 4px 14px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.timeline-track::-webkit-scrollbar { height: 8px; }
.timeline-track::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; }
.tl-item { position: relative; flex: 0 0 auto; width: 176px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; animation: fadeInUp .4s var(--ease) both; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); order: 2; margin-top: -8px; position: relative; z-index: 2; box-shadow: 0 0 0 4px var(--bg); }
.tl-dot.pending { background: var(--amber); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(251, 191, 36, .25); } 50% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 10px rgba(251, 191, 36, 0); } }
.tl-card { order: 1; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.tl-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.tl-img { position: relative; aspect-ratio: 4/3; background: var(--panel-3); }
.tl-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-badge { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .65); color: var(--amber); font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px); }
.tl-del { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 9px; border: none; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; backdrop-filter: blur(4px); }
.tl-card:hover .tl-del { opacity: 1; }
.tl-del:hover { background: var(--red); }
.tl-date { padding: 9px 11px; font-size: 11.5px; color: var(--muted); order: 3; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-content: center; z-index: 100; padding: 24px; animation: fadeIn .2s ease; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow); }
.lightbox-close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; cursor: pointer; }

/* ============================================================
   Sincronizar
   ============================================================ */
.sync-status { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 8px; flex-wrap: wrap; }
.sync-status.online { border-color: rgba(52, 211, 153, .3); }
.ss-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-content: center; font-size: 22px; background: var(--panel-3); }
.sync-status.online .ss-icon { background: rgba(52, 211, 153, .15); color: var(--green); }
.sync-status.offline .ss-icon { background: rgba(251, 191, 36, .15); color: var(--amber); }
.ss-text { flex: 1; min-width: 160px; }
.ss-text strong { display: block; font-size: 15px; }
.ss-text span { color: var(--muted); font-size: 13px; }
.sync-status .btn-accent { margin-left: auto; }
.toast-inline { margin: 14px 0 0; padding: 12px 16px; border-radius: 12px; background: rgba(52, 211, 153, .1); }
.toast-inline.error-flash { background: rgba(239, 68, 68, .1); color: #ef4444; }

.pend-list { display: flex; flex-direction: column; gap: 8px; }
.pend-item { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; }
.pend-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--panel-3); display: grid; place-content: center; font-size: 16px; color: var(--accent); }
.pend-info { flex: 1; min-width: 0; }
.pend-desc { font-size: 13.5px; font-weight: 500; }
.pend-time { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.offline-list { display: flex; flex-direction: column; gap: 8px; }
.offline-item { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; }
.oi-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--panel-3); display: grid; place-content: center; font-size: 18px; color: var(--accent); }
.oi-info { flex: 1; min-width: 0; }
.oi-title { font-weight: 600; font-size: 14px; }
.oi-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   Login
   ============================================================ */
.login-screen { display: flex; min-height: 100vh; min-height: 100dvh; }
.login-hero { flex: 1; background: linear-gradient(150deg, #1d2026, #16181d 60%, #14233f); display: flex; align-items: center; justify-content: center; padding: 40px; position: relative; overflow: hidden; }
.login-hero::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(91, 140, 255, .22), transparent 70%); top: -120px; right: -120px; }
.login-hero::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(52, 211, 153, .14), transparent 70%); bottom: -100px; left: -80px; }
.hero-content { max-width: 400px; position: relative; z-index: 1; }
.hero-content h1 { font-size: 38px; font-weight: 800; margin: 22px 0 14px; }
.hero-content h1 span { color: var(--brand); }
.hero-content p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.hero-list { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.hero-list li { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 14px; }
.hero-list i { width: 34px; height: 34px; border-radius: 10px; background: var(--panel); display: grid; place-content: center; color: var(--brand); font-size: 16px; }

.login-form-wrap { flex: 0 0 460px; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 26px; }
.login-card .muted { margin: 6px 0 26px; font-size: 14px; }
.login-card .field { margin-bottom: 16px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > i { position: absolute; left: 14px; color: var(--muted); font-size: 16px; pointer-events: none; }
.input-icon input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px 13px 42px; color: var(--text); font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.input-icon input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, .15); }
.toggle-eye { position: absolute; right: 8px; background: transparent; border: none; color: var(--muted); width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.alert-error { background: rgba(248, 113, 113, .12); color: #fca5a5; border-radius: 11px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px; }

.centered-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; padding: 24px; }
.splash { display: grid; place-items: center; gap: 18px; }
.splash-logo { width: 70px; height: 70px; border-radius: 20px; background: linear-gradient(135deg, var(--panel-3), var(--panel)); display: grid; place-content: center; font-size: 32px; color: var(--accent); box-shadow: var(--shadow); }
.splash-title { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.loader-bar { width: 150px; height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 4px; animation: slide 1.1s var(--ease) infinite; }
.glass-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============================================================
   Animations / utilities
   ============================================================ */
.fade-in { animation: fadeIn .35s var(--ease) both; }
.fade-in-up { animation: fadeInUp .45s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.loading .spinner { color: var(--accent-ink); }

.stagger > * { animation: fadeInUp .45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .1s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .3s; }

/* ============================================================
   Blazor error UI
   ============================================================ */
#blazor-error-ui { background: #2a2d34; color: var(--text); bottom: 0; box-shadow: 0 -1px 6px rgba(0, 0, 0, .4); display: none; left: 0; padding: 12px 18px; position: fixed; width: 100%; z-index: 1000; font-size: 13.5px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 10px; }
#blazor-error-ui .reload { color: var(--brand); text-decoration: underline; }

/* ============================================================
   Responsive — tablets & phones
   ============================================================ */
@media (max-width: 920px) {
    .login-hero { display: none; }
    .login-form-wrap { flex: 1; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
        transform: translateX(-100%); transition: transform .3s var(--ease);
        box-shadow: var(--shadow); height: 100vh; height: 100dvh;
    }
    .sidebar.open { transform: translateX(0); }
    .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 50; animation: fadeIn .2s ease; }
    .hamburger { display: inline-grid; }
    .content-area { padding: 18px 16px; }
    .topbar { padding: 12px 16px; }
    .topbar-title { display: none; }
    .page-title { font-size: 22px; }
    .form-grid { grid-template-columns: 1fr; }
    .grid-cards { grid-template-columns: 1fr; }
    .tabs { width: 100%; }
    .conn-label { display: none; }
    .conn-pill.compact { padding: 8px; }
}

@media (max-width: 480px) {
    .offline-banner { flex-direction: column; align-items: stretch; }
    .ob-actions { justify-content: space-between; }
    .tl-item { width: 150px; }
    .sync-status .btn-accent { margin-left: 0; width: 100%; }
}
