/* ============================================================
   DSS v2 — design system
   A calm, business-application look: light content surfaces,
   a dark slate navigation rail, one indigo accent.
   ============================================================ */

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;

    --brand: #4f46e5;
    --brand-700: #4338ca;
    --brand-50: #eef2ff;
    --ring: rgba(79, 70, 229, 0.30);

    --success: #15803d;
    --success-bg: #dcfce7;
    --warn: #b45309;
    --warn-bg: #fef3c7;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --info: #1d4ed8;
    --info-bg: #dbeafe;
    --neutral-bg: #f1f5f9;
    --neutral-fg: #475569;

    --radius: 10px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.10), 0 1px 2px rgba(16, 24, 40, 0.06);

    --sidebar-w: 264px;
    --topbar-h: 60px;
}

html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    color: var(--text);
    letter-spacing: -0.01em;
}

.content {
    padding: 1.75rem 2rem 3rem;
    max-width: 1320px;
}

h1:focus {
    outline: none;
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.95rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
}

.btn-outline-primary {
    color: var(--brand);
    border-color: var(--border-strong);
    background: var(--surface);
}

.btn-outline-primary:hover {
    background-color: var(--brand-50);
    border-color: var(--brand);
    color: var(--brand-700);
}

.btn-outline-secondary {
    color: var(--text-2);
    border-color: var(--border-strong);
    background: var(--surface);
}

.btn-outline-secondary:hover {
    background-color: var(--surface-2);
    border-color: var(--muted);
    color: var(--text);
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--border-strong);
    background: var(--surface);
}

.btn-outline-danger:hover {
    background-color: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.btn:focus, .btn:active:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem var(--ring);
    border-color: var(--brand);
    outline: none;
}

/* ---------- Forms ---------- */

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    font-size: 0.9rem;
    padding: 0.5rem 0.7rem;
    color: var(--text);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-check-input {
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* ---------- Page heading ---------- */

.page-heading {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-heading h1 {
    font-size: 1.65rem;
    font-weight: 650;
    margin: 0;
}

.eyebrow {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
}

.lead {
    color: var(--muted);
    max-width: 70ch;
    font-size: 1rem;
}

/* ---------- Dashboard metrics ---------- */

.metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    margin: 1.5rem 0 2.5rem;
}

.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.2rem;
    position: relative;
    overflow: hidden;
}

.metric::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand);
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
}

.metric strong {
    color: var(--text);
    display: block;
    font-size: 1.9rem;
    font-weight: 650;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* ---------- Workflow band / quick links ---------- */

.workflow-band {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.workflow-band h2 {
    font-size: 1.05rem;
    font-weight: 650;
    margin-bottom: 0.9rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.quick-links a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 0.9rem;
    transition: border-color 0.12s ease, color 0.12s ease;
}

.quick-links a:hover {
    border-color: var(--brand);
    color: var(--brand-700);
    text-decoration: none;
}

/* ---------- Tables (data grid) ---------- */

.table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    width: 100%;
    margin: 0;
}

.table thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.7rem 0.9rem;
    vertical-align: middle;
}

.table tbody td {
    border-top: 1px solid var(--border);
    color: var(--text-2);
    padding: 0.7rem 0.9rem;
    vertical-align: middle;
}

.table tbody tr:first-child td {
    border-top: none;
}

.table tbody tr:hover td {
    background: var(--brand-50);
}

.table-responsive {
    border-radius: var(--radius);
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.table-actions .btn {
    margin-left: 0.35rem;
}

.table-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
    color: var(--text-2);
    font-weight: 500;
}

/* ---------- Status pills ---------- */

.status-pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.18rem 0.6rem;
    background: var(--neutral-bg);
    color: var(--neutral-fg);
}

.status-pill.is-active, .status-pill.is-resolved { background: var(--success-bg); color: var(--success); }
.status-pill.is-pending, .status-pill.is-waiting, .status-pill.is-renewal { background: var(--warn-bg); color: var(--warn); }
.status-pill.is-open, .status-pill.is-progress { background: var(--info-bg); color: var(--info); }
.status-pill.is-closed, .status-pill.is-archived { background: var(--neutral-bg); color: var(--neutral-fg); }
.status-pill.is-critical { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms layout helpers ---------- */

.form-grid {
    display: grid;
    gap: 1.1rem 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    max-width: 70rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.compact-form {
    max-width: 70rem;
}

.form-grid label {
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-grid .form-check,
.form-grid .form-switch {
    align-items: center;
    flex-direction: row;
    display: flex;
    gap: 0.5rem;
    margin-top: 1.7rem;
}

.form-grid-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 0.7rem;
    margin-top: 1.25rem;
    align-items: center;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.toolbar-row .form-control {
    max-width: 22rem;
}

/* ---------- Validation ---------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ---------- Alerts ---------- */

.alert {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.alert-info { background: var(--info-bg); border-color: #bfdbfe; color: #1e40af; }
.alert-danger { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warn-bg); border-color: #fde68a; color: #92400e; }

/* ---------- Login (landing) ---------- */

.auth-landing {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

/* Left: branded info panel */
.auth-hero {
    position: relative;
    color: #e2e8f0;
    background:
        radial-gradient(800px 500px at 15% 10%, rgba(99, 102, 241, 0.35), transparent 60%),
        radial-gradient(700px 600px at 100% 100%, rgba(56, 189, 248, 0.18), transparent 55%),
        linear-gradient(160deg, #1e1b4b 0%, #0f172a 70%);
    display: flex;
    align-items: center;
    padding: 3rem;
    overflow: hidden;
}

.auth-hero-inner {
    max-width: 30rem;
    margin-left: auto;
}

.auth-hero .brand-logo {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 9px;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.auth-hero .brand-mark {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 2.5rem;
}

.auth-hero .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.auth-hero .brand-name {
    color: #f8fafc;
    font-weight: 700;
    font-size: 1.05rem;
}

.auth-hero .brand-sub {
    color: #a5b4fc;
    font-size: 0.78rem;
}

.auth-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem;
}

.auth-tagline {
    color: #cbd5e1;
    font-size: 1.02rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: grid;
    gap: 0.75rem;
}

.auth-features li {
    position: relative;
    padding-left: 2rem;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.auth-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.2);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.5);
    -webkit-mask: none;
}

.auth-features li::after {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.38rem;
    width: 0.62rem;
    height: 0.34rem;
    border-left: 2px solid #a5b4fc;
    border-bottom: 2px solid #a5b4fc;
    transform: rotate(-45deg);
}

.auth-foot {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* Right: sign-in card */
.auth-form-pane {
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 24rem;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 650;
    margin: 0 0 0.25rem;
}

.login-sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.login-card label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 1rem;
}

.login-card label .form-control {
    margin-top: 0.35rem;
}

.btn-block {
    width: 100%;
}

.login-hint {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
}

.login-hint code {
    color: var(--brand-700);
    background: var(--brand-50);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    font-size: 0.78rem;
}

@media (max-width: 860px) {
    .auth-landing {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        padding: 2.5rem 1.5rem;
    }

    .auth-hero-inner {
        margin: 0 auto;
        max-width: 32rem;
    }

    .auth-title {
        font-size: 1.6rem;
    }

    /* Trim the longer feature list on small screens to keep the form close. */
    .auth-features {
        margin-bottom: 0;
    }

    .auth-foot {
        display: none;
    }
}

/* ---------- Support ticket detail ---------- */

.detail-columns {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.detail-columns section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.detail-columns h2 {
    font-size: 1rem;
    font-weight: 650;
    margin: 0 0 0.75rem;
}

.attachment-list, .history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attachment-list li, .history-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.attachment-list li:last-child, .history-list li:last-child {
    border-bottom: none;
}

.history-time {
    color: var(--muted);
    font-size: 0.8rem;
    min-width: 9rem;
}

.history-author {
    font-weight: 700;
    color: var(--text-2);
    font-size: 0.85rem;
}

.history-note {
    color: var(--text-2);
    font-size: 0.9rem;
}

/* ---------- Sidebar navigation rail ----------
   Styled globally (scoped under .sidebar) so it also reaches the
   anchors rendered by the NavLink child component. */

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    height: var(--topbar-h, 60px);
    padding: 0 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-logo {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.sidebar .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar .brand-name {
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.95rem;
}

.sidebar .brand-sub {
    color: #94a3b8;
    font-size: 0.72rem;
}

.sidebar .nav-rail {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem 0.75rem 1.5rem;
}

.sidebar .nav-section {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 1rem 0 0.35rem;
    padding: 0 0.65rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar .nav-link:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #fff;
    text-decoration: none;
}

.sidebar .nav-link.active {
    background: var(--brand, #4f46e5);
    color: #fff;
}

.sidebar .nav-link.active .nav-ico {
    background-color: #fff;
}

.sidebar .nav-ico {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    background-color: #94a3b8;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.sidebar .nav-link:hover .nav-ico {
    background-color: #fff;
}

.ico-home { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E"); }
.ico-customers { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5.784 6A2.24 2.24 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.3 6.3 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1zM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5'/%3E%3C/svg%3E"); }
.ico-contacts { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm11-9a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5m.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm11-9a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5m.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1z'/%3E%3C/svg%3E"); }
.ico-products { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2zM3.564 1.426 5.596 5 8 5.961 14.154 3.5zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24ZM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874-.002.001a.5.5 0 0 1-.368 0l-.003-.001-7.184-2.874A1 1 0 0 1 0 12.162V3.5a.5.5 0 0 1 .314-.464z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2zM3.564 1.426 5.596 5 8 5.961 14.154 3.5zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24ZM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874-.002.001a.5.5 0 0 1-.368 0l-.003-.001-7.184-2.874A1 1 0 0 1 0 12.162V3.5a.5.5 0 0 1 .314-.464z'/%3E%3C/svg%3E"); }
.ico-modules { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-contracts { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5zM4.5 9.5A.5.5 0 0 1 5 9h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5m0 2A.5.5 0 0 1 5 11h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5m0-4A.5.5 0 0 1 5 7h3a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5zM4.5 9.5A.5.5 0 0 1 5 9h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5m0 2A.5.5 0 0 1 5 11h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5m0-4A.5.5 0 0 1 5 7h3a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5'/%3E%3C/svg%3E"); }
.ico-support { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5'/%3E%3C/svg%3E"); }
.ico-economy { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.136.326A1.5 1.5 0 0 1 14 1.78V3h.5A1.5 1.5 0 0 1 16 4.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 13.5v-9a1.5 1.5 0 0 1 1.432-1.499zM5.562 3H13V1.78a.5.5 0 0 0-.621-.484zM1.5 4a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.136.326A1.5 1.5 0 0 1 14 1.78V3h.5A1.5 1.5 0 0 1 16 4.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 13.5v-9a1.5 1.5 0 0 1 1.432-1.499zM5.562 3H13V1.78a.5.5 0 0 0-.621-.484zM1.5 4a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5z'/%3E%3C/svg%3E"); }
.ico-admin { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.998 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM8 4a1.5 1.5 0 0 1 .5 2.915V8.5a.5.5 0 0 1-1 0V6.915A1.5 1.5 0 0 1 8 4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.998 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM8 4a1.5 1.5 0 0 1 .5 2.915V8.5a.5.5 0 0 1-1 0V6.915A1.5 1.5 0 0 1 8 4'/%3E%3C/svg%3E"); }
.ico-signin { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-1 0v2A1.5 1.5 0 0 0 6.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-8A1.5 1.5 0 0 0 5 3.5v2a.5.5 0 0 0 1 0z'/%3E%3Cpath d='M.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L1.707 7.5H10.5a.5.5 0 0 1 0 1H1.707l2.147 2.146a.5.5 0 0 1-.708.708z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-1 0v2A1.5 1.5 0 0 0 6.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-8A1.5 1.5 0 0 0 5 3.5v2a.5.5 0 0 0 1 0z'/%3E%3Cpath d='M.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L1.707 7.5H10.5a.5.5 0 0 1 0 1H1.707l2.147 2.146a.5.5 0 0 1-.708.708z'/%3E%3C/svg%3E"); }

/* ---------- Blazor framework UI ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 640px) {
    .content {
        padding: 1.25rem 1rem 2rem;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-actions {
        text-align: left;
    }
}

/* ---------- Audit line ---------- */

.audit-info {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-info strong { color: var(--text-2); font-weight: 600; }
.audit-sep { color: var(--border-strong); }
.audit-ico {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--border-strong);
}

/* ---------- Sortable headers ---------- */

.table thead th.sortable { padding: 0; }

.sort-btn {
    width: 100%;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 0.9rem;
    text-align: left;
}

.sort-btn:hover { color: var(--text); }
.sort-arrow { color: var(--border-strong); font-size: 0.75rem; }
.table thead th.is-sorted .sort-btn { color: var(--brand-700); }
.table thead th.is-sorted .sort-arrow { color: var(--brand); }

/* ---------- Table muted / empty cells ---------- */

.cell-muted { color: var(--muted); }
.cell-empty { color: var(--muted); text-align: center; padding: 1.5rem !important; }

/* ---------- Pager ---------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    color: var(--text-2);
    font-size: 0.85rem;
}

.pager-controls { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.pager-size { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-weight: 500; }
.pager-size .form-select { width: auto; padding: 0.25rem 1.6rem 0.25rem 0.55rem; }
.pager-nav { display: inline-flex; align-items: center; gap: 0.3rem; }
.pager-page { padding: 0 0.5rem; white-space: nowrap; }
.pager .btn:disabled { opacity: 0.45; }

/* ---------- Dashboard: KPI cards ---------- */

.heading-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.kpi-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    margin: 0 0 1.5rem;
}

.kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.05rem 1.15rem 1.1rem;
    display: flex;
    flex-direction: column;
}

.kpi-ico {
    position: absolute;
    top: 1.1rem;
    right: 1.15rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    background: var(--brand);
}

.kpi-ico.is-customers { background: var(--brand); }
.kpi-ico.is-contracts { background: var(--success); }
.kpi-ico.is-support { background: var(--info); }
.kpi-ico.is-critical { background: var(--danger); }
.kpi-ico.is-economy { background: var(--warn); }

.kpi-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; padding-right: 1rem; }
.kpi-value { color: var(--text); font-size: 2rem; font-weight: 650; line-height: 1.1; margin-top: 0.3rem; }
.kpi-sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.kpi-flag { color: var(--danger); font-weight: 600; }
.kpi.tone-danger { border-left: 3px solid var(--danger); }
.kpi.tone-warn { border-left: 3px solid var(--warn); }

/* ---------- Dashboard: panels ---------- */

.dash-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    margin-bottom: 2rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.35rem 1.4rem;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.panel-head a { font-size: 0.82rem; font-weight: 600; }
.panel-hint { color: var(--muted); font-size: 0.78rem; }
.panel-caption { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.6rem; }
.panel-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.panel-figure { display: flex; align-items: baseline; justify-content: space-between; margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.panel-figure span { color: var(--muted); font-size: 0.82rem; }
.panel-figure strong { font-size: 1.25rem; font-weight: 650; color: var(--text); }

/* ---------- Dashboard: bar chart ---------- */

.barchart { display: flex; flex-direction: column; gap: 0.5rem; }
.bar-row { display: grid; grid-template-columns: 5.5rem 1fr 2rem; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.bar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; height: 0.62rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--neutral-fg); min-width: 0.15rem; }
.bar-fill.is-active, .bar-fill.is-resolved { background: var(--success); }
.bar-fill.is-pending, .bar-fill.is-waiting, .bar-fill.is-renewal { background: var(--warn); }
.bar-fill.is-open, .bar-fill.is-progress { background: var(--info); }
.bar-fill.is-closed, .bar-fill.is-archived { background: var(--neutral-fg); }
.bar-fill.is-critical { background: var(--danger); }
.bar-value { text-align: right; font-weight: 650; color: var(--text); }

/* ---------- Dashboard: attention lists ---------- */

.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.attention-list li:last-child { border-bottom: none; }
.att-main { display: grid; gap: 0.1rem; min-width: 0; }
.att-main:hover { text-decoration: none; }
.att-main:hover .att-subject { color: var(--brand-700); }
.att-ref { font-size: 0.72rem; font-weight: 700; color: var(--brand-700); letter-spacing: 0.02em; }
.att-subject { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-customer { color: var(--muted); font-size: 0.8rem; }
.att-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; white-space: nowrap; }
.att-deadline { font-size: 0.8rem; color: var(--text-2); }
.att-deadline.is-overdue { color: var(--danger); font-weight: 600; }

@media (max-width: 560px) {
    .panel-split { grid-template-columns: 1fr; gap: 1.1rem; }
    .pager { justify-content: flex-start; }
}
