:root {
    --blue: #28478D;
    --orange: #F37F1F;
    --yellow: #F0D60C;
    --text: #1F2937;
    --bg: #F8FAFC;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; background: var(--blue); color: #fff; position: fixed; inset: 0 auto 0 0; padding: 18px 14px; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; padding: 8px 10px 20px; }
.brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 11px 12px; border-radius: 8px; margin: 3px 0; font-weight: 600; }
.sidebar nav a.active, .sidebar nav a:hover { background: var(--orange); color: #fff; }
.sidebar nav a .nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #dc2626; color: #fff; font-size: 12px; line-height: 1; font-weight: 800; }
.main { margin-left: 270px; width: calc(100% - 270px); }
.topbar { min-height: 76px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 16px; padding: 14px 24px; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 800; }
.topbar span { color: #64748b; font-size: 13px; }
.content { padding: 24px; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.metric { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; min-height: 124px; }
.metric-link { display: block; color: var(--text); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.metric-link:hover { color: var(--text); transform: translateY(-2px); border-color: rgba(40,71,141,.35); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.metric .icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: rgba(243,127,31,.12); color: var(--orange); }
.metric strong { display: block; font-size: 28px; margin-top: 12px; }
.metric span { color: #64748b; font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; align-items: center; }
.search { display: flex; gap: 8px; max-width: 420px; flex: 1; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: #1f3975; border-color: #1f3975; }
.badge-status { background: rgba(40,71,141,.1); color: var(--blue); }
.badge .bi { margin-right: 4px; }
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}
.status-chip .bi { margin-right: 0; font-size: 12px; }
.status-stack { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invoice-meta-badges { margin-top: 8px; justify-content: flex-end; }
.sync-progress-panel { border-left: 4px solid var(--blue); }
.sync-progress-bar-wrap { height: 10px; background: #e8eefb; border-radius: 999px; overflow: hidden; }
.sync-progress-bar { background: linear-gradient(90deg, var(--blue), var(--orange)); }
.sync-summary-card { border-left: 4px solid var(--orange); }
.sync-rotating { animation: syncSpin 1s linear infinite; display: inline-block; }
@keyframes syncSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.domain-alert-blink { animation: domainAlertBlink 1s ease-in-out infinite; }
@keyframes domainAlertBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(240, 214, 12, .55); }
    50% { opacity: .48; box-shadow: 0 0 0 4px rgba(240, 214, 12, .16); }
}
.auth-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #f8fafc 0%, #e9eefb 100%); padding: 20px; }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 30px; }
.auth-card img { width: 80px; height: 80px; object-fit: contain; display: block; margin: 0 auto 14px; }
.invoice-box { background: #fff; padding: 30px; border: 1px solid #e5e7eb; }
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .content { padding: 16px; }
    .toolbar { flex-direction: column; align-items: stretch; }
}
