:root {
    /* Identidad institucional FixPoint Labs */
    --inst-navy: #0c2d4a;
    --inst-navy-mid: #1a4a72;
    --inst-navy-light: #2a5f8f;
    --inst-gold: #c9a227;
    --inst-gold-soft: rgba(201, 162, 39, 0.12);

    --bg-primary: #eef2f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #1a4a72;
    --accent-hover: #0c2d4a;
    --accent-glow: rgba(26, 74, 114, 0.15);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.08);
    --purple: #1a4a72;
    --sidebar-width: 268px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 40px rgba(15, 23, 42, 0.08);
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--inst-navy-light);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.auth-background {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(160deg, var(--inst-navy) 0%, var(--inst-navy-mid) 45%, #eef2f7 45%);
    z-index: 0;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.install-container {
    max-width: 560px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow);
}

.install-card {
    max-width: 100%;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--inst-navy), var(--inst-navy-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.brand-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-form fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.auth-form legend {
    padding: 0 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--inst-navy) 0%, #0a2540 100%);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    box-shadow: 4px 0 24px rgba(12, 45, 74, 0.12);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon-sm {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon-sm svg {
    width: 20px;
    height: 20px;
    color: white;
}

.sidebar-brand strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    color: #fff;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--inst-gold);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.9;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.2;
    color: #fff;
}

.user-info span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-footer .btn-ghost {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-footer .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

.topbar-title h1 {
    font-size: 1.15rem;
    font-weight: 600;
    flex: 1;
    color: var(--inst-navy);
}

.topbar-actions {
    margin-left: auto;
}

.main-content {
    padding: 24px;
    flex: 1;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, var(--bg-muted), var(--bg-card));
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--inst-navy);
}

.card-form {
    padding: 22px;
}

.card-form .card-header {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    border-bottom: none;
    margin-bottom: 8px;
}

.card-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow);
}

.stat-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-blue { background: rgba(26, 74, 114, 0.12); color: var(--accent); }
.stat-icon-green { background: var(--success-bg); color: var(--success); }
.stat-icon-orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon-purple { background: var(--inst-gold-soft); color: var(--inst-gold); }

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.repair-grid .repair-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.repair-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.users-grid {
    grid-template-columns: 380px 1fr;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 22px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.actions {
    text-align: right;
    white-space: nowrap;
}

.link-primary {
    color: var(--accent);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-received { background: rgba(26, 74, 114, 0.12); color: var(--inst-navy-mid); }
.status-diagnosing { background: rgba(42, 95, 143, 0.12); color: var(--inst-navy-light); }
.status-waiting { background: var(--warning-bg); color: var(--warning); }
.status-repair { background: rgba(201, 162, 39, 0.15); color: #92700f; }
.status-ready { background: var(--success-bg); color: var(--success); }
.status-delivered { background: rgba(100, 116, 139, 0.12); color: var(--text-secondary); }
.status-cancelled { background: var(--error-bg); color: var(--error); }
.status-default { background: rgba(100, 116, 139, 0.12); color: var(--text-secondary); }

.stock-ok { background: var(--success-bg); color: var(--success); }
.stock-low { background: var(--warning-bg); color: var(--warning); }
.stock-out { background: var(--error-bg); color: var(--error); }

.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.row-warning { background: rgba(245, 158, 11, 0.04); }
.row-alert { background: rgba(239, 68, 68, 0.04); }

code.sku {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stat-card-sm {
    padding: 16px;
}

.stat-card-sm .stat-value {
    font-size: 1.25rem;
}

.part-form-grid {
    grid-template-columns: 1fr 340px;
}

.part-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stock-display {
    padding: 20px 22px;
}

.form-row-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 0 22px 22px;
    flex-wrap: wrap;
}

.form-row-inline .flex-grow {
    flex: 1;
    min-width: 200px;
}

.form-row-inline .qty-field {
    width: 80px;
}

.form-row-inline .btn-field {
    flex-shrink: 0;
}

.input-secondary {
    margin-top: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.low-stock-list {
    padding: 8px 22px 16px;
}

.low-stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.low-stock-item:last-child {
    border-bottom: none;
}

.low-stock-item a {
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .stats-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .part-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid-5 {
        grid-template-columns: 1fr 1fr;
    }
}

.priority-low { background: rgba(100, 116, 139, 0.12); color: var(--text-secondary); }
.priority-normal { background: rgba(26, 74, 114, 0.12); color: var(--inst-navy-mid); }
.priority-high { background: var(--warning-bg); color: var(--warning); }
.priority-urgent { background: var(--error-bg); color: var(--error); }

.badge-category {
    background: var(--bg-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input-icon {
    position: relative;
}

.input-icon svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon input {
    padding-left: 40px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: 16px 0;
    margin-top: 8px;
    z-index: 10;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toggle-panel.hidden {
    display: none;
}

.inline-form {
    display: inline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--inst-navy-mid), var(--inst-navy));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--inst-navy), #081f33);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-outline-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Toolbar */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 700px;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 200px;
}

.filters-form select {
    min-width: 160px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.page-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.page-link.active {
    background: var(--accent);
    color: white;
}

/* Detail views */
.detail-list {
    padding: 16px 22px 22px;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.detail-list > div:last-child {
    border-bottom: none;
}

.detail-list dt {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.detail-list dd {
    text-align: right;
    font-size: 0.9rem;
}

.detail-list.compact > div {
    padding: 8px 0;
}

.detail-text {
    padding: 16px 22px 22px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.repair-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

/* Repair view page */
.repair-page {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    min-width: 0;
}

.repair-page-nav {
    margin-bottom: 12px;
}

.repair-back-link {
    padding-left: 0;
}

.repair-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.repair-header-main {
    flex: 1;
    min-width: 0;
}

.repair-page-header .repair-title {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 8px 0 4px;
    line-height: 1.25;
    word-break: break-word;
}

.repair-meta {
    font-size: 0.85rem;
    line-height: 1.5;
}

.repair-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.repair-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.repair-aside,
.repair-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

@media (min-width: 1024px) {
    .repair-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 20px;
    }

    .repair-content {
        grid-column: 1;
        grid-row: 1;
    }

    .repair-aside {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: calc(var(--topbar-height) + 16px);
        max-height: calc(100vh - var(--topbar-height) - 32px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

.repair-status-card {
    border-top: 3px solid var(--inst-gold);
}

.card-body-text {
    padding: 16px 22px 22px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.92rem;
}

.card-form-inner {
    padding: 0 22px 22px;
}

.card-header-value {
    font-size: 0.95rem;
    color: var(--inst-navy);
}

.form-actions-flush {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.timeline-empty {
    padding: 16px 22px 22px;
}

/* Unified info fields (cliente, dispositivo, costos) */
.info-fields {
    display: flex;
    flex-direction: column;
}

.info-fields-padded {
    padding: 4px 22px 20px;
}

.info-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 640px) {
    .info-fields-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
    }

    .info-field-full {
        grid-column: 1 / -1;
    }
}

.info-field {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.info-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.info-field-row .info-field-label {
    margin-bottom: 0;
    flex-shrink: 0;
}

.info-field-row .info-field-value {
    text-align: right;
}

.info-field-highlight {
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid var(--border);
}

.info-field-highlight .info-field-value strong {
    color: var(--inst-navy);
    font-size: 1.05rem;
}

.info-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.info-field-value {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.55;
    word-break: break-word;
}

.info-field-value.is-empty {
    color: var(--text-muted);
    font-style: italic;
}

.info-field-mono {
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.02em;
    font-size: 0.88rem;
}

/* Legacy customer aliases */
.customer-field { padding: 11px 0; border-bottom: 1px solid var(--border); }
.customer-field-label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 5px; }
.customer-field-value { display: block; font-size: 0.9rem; color: var(--text-primary); line-height: 1.55; word-break: break-word; }
.customer-field-mono { font-family: 'Consolas', 'Monaco', monospace; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-block-mobile {
    width: auto;
}

.col-actions {
    width: 72px;
}

.ticket-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--inst-navy-mid), var(--inst-navy));
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.04em;
}

.repair-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.repair-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status list */
.status-list {
    padding: 16px 22px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.status-item:last-child {
    border-bottom: none;
}

.mini-stats {
    padding: 0 22px 20px;
}

.mini-stats > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.mini-stats span {
    color: var(--text-muted);
}

/* Timeline */
.timeline {
    padding: 16px 22px 22px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 12px;
    height: 12px;
    background: var(--inst-navy-mid);
    border: 2px solid var(--inst-gold-soft);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.timeline-content strong {
    font-size: 0.85rem;
}

.timeline-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 2px 0;
}

.timeline-content small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .filters-form select {
        min-width: 0;
        flex: 1 1 140px;
    }

    .repair-grid,
    .part-form-grid {
        grid-template-columns: 1fr;
    }

    .repair-header {
        flex-direction: column;
    }

    .repair-header-badges {
        width: 100%;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .audit-table .audit-desc {
        max-width: 160px;
        word-break: break-word;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h2 {
        flex: 1;
        min-width: 0;
    }

    .form-row-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row-inline .qty-field,
    .form-row-inline .btn-field {
        width: 100%;
    }

    .public-header-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .public-grid,
    .track-tiles {
        grid-template-columns: 1fr;
    }

    .track-search-fields {
        grid-template-columns: 1fr;
    }

    .track-search-action-label {
        display: none;
    }

    .track-summary-top {
        flex-direction: column;
    }

    .track-stepper {
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .track-step-label {
        font-size: 0.65rem;
        max-width: 64px;
    }

    .repair-grid,
    .content-grid,
    .users-grid,
    .part-form-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .repair-main,
    .repair-sidebar {
        min-width: 0;
    }

    .main-content {
        padding: 16px;
        min-width: 0;
    }

    .repair-page-header {
        flex-direction: column;
    }

    .repair-header-badges {
        width: 100%;
        justify-content: flex-start;
    }

    .repair-aside {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .repair-stepper {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: visible;
        padding: 8px 0 12px;
    }

    .repair-stepper::before {
        display: none;
    }

    .repair-stepper .track-step {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }

    .repair-stepper .track-step:last-child {
        border-bottom: none;
    }

    .repair-stepper .track-step-label {
        max-width: none;
        font-size: 0.82rem;
    }

    .info-field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-field-row .info-field-value {
        text-align: left;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .topbar {
        padding: 0 12px;
    }

    .topbar-title h1 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ticket-badge-lg {
        font-size: 1rem;
    }

    .stats-grid-3 {
        grid-template-columns: 1fr;
    }

    .stats-grid-5 {
        grid-template-columns: 1fr;
    }

    .topbar-actions .btn span {
        display: none;
    }

    .detail-list > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .detail-list dd {
        text-align: left;
    }

    .nowrap {
        white-space: normal;
    }
}

/* Track page (portal público) */
.track-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    color-scheme: light;
}

.track-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.track-topbar {
    background: var(--inst-navy);
    border-bottom: 3px solid var(--inst-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(12, 45, 74, 0.15);
}

.track-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    min-height: 56px;
}

.track-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}

.track-brand:hover {
    color: #fff;
    opacity: 0.95;
}

.track-brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-brand-icon svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    color: #fff;
}

.track-brand-text {
    min-width: 0;
}

.track-brand-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-brand-text span {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-login-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.track-main {
    flex: 1;
    padding: 20px 0 32px;
    width: 100%;
}

.track-search-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.track-panel-head {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.track-panel-head h1 {
    font-size: clamp(1.2rem, 4.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--inst-navy);
    line-height: 1.3;
    margin-bottom: 8px;
}

.track-panel-head p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.track-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.track-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.track-search-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.track-search-action {
    min-width: 180px;
}

.track-search-action-label {
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
}

.track-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.track-summary {
    padding: 0;
}

.track-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 24px 0;
    flex-wrap: wrap;
}

.track-ticket {
    display: inline-block;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--inst-navy);
    background: var(--inst-gold-soft);
    border: 1px solid rgba(201, 162, 39, 0.35);
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.track-summary-id h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.track-summary-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.track-summary-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.track-stepper {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    padding: 24px 24px 8px;
    position: relative;
}

.track-stepper::before {
    content: '';
    position: absolute;
    top: 38px;
    left: 48px;
    right: 48px;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.track-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.track-step-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-muted);
    border: 2px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.track-step-marker svg {
    width: 16px;
    height: 16px;
}

.track-step-completed .track-step-marker {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.track-step-current .track-step-marker {
    background: var(--inst-navy);
    border-color: var(--inst-gold);
    color: #fff;
    box-shadow: 0 0 0 4px var(--inst-gold-soft);
}

.track-step-pending .track-step-marker {
    background: var(--bg-card);
}

.track-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.25;
    max-width: 88px;
}

.track-step-completed .track-step-label {
    color: var(--success);
}

.track-step-current .track-step-label {
    color: var(--inst-navy);
}

.track-status-message {
    margin: 8px 24px 24px;
    padding: 14px 18px;
    background: var(--bg-muted);
    border-left: 4px solid var(--inst-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.track-status-message p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.track-cancelled-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 16px 24px 0;
    padding: 16px 18px;
    background: var(--error-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-sm);
}

.track-cancelled-banner svg {
    width: 22px;
    height: 22px;
    color: var(--error);
    flex-shrink: 0;
}

.track-cancelled-banner strong {
    display: block;
    color: var(--error);
    margin-bottom: 4px;
}

.track-cancelled-banner p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.track-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 768px) {
    .track-wrap {
        max-width: 960px;
    }

    .track-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

.track-tile {
    display: flex;
    gap: 14px;
    padding: 18px;
    flex-direction: column;
}

@media (min-width: 540px) {
    .track-tile {
        flex-direction: row;
    }
}

.track-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-tile-icon svg {
    width: 22px;
    height: 22px;
}

.track-tile-icon-device {
    background: rgba(26, 74, 114, 0.1);
    color: var(--inst-navy-mid);
}

.track-tile-icon-info {
    background: var(--inst-gold-soft);
    color: #92700f;
}

.track-tile-icon-cost {
    background: var(--success-bg);
    color: var(--success);
}

.track-tile-body {
    flex: 1;
    min-width: 0;
}

.track-tile-body h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--inst-navy);
    margin-bottom: 12px;
}

.track-kv > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.track-kv > div:last-child {
    border-bottom: none;
}

.track-kv dt {
    color: var(--text-muted);
    flex-shrink: 0;
}

.track-kv dd {
    text-align: right;
    font-weight: 500;
    color: var(--text-primary);
}

.track-kv-total {
    padding-top: 8px !important;
    margin-top: 4px;
    border-top: 2px solid var(--border) !important;
}

.track-kv-total dd {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--inst-navy);
}

.track-kv-balance dd {
    color: var(--warning);
    font-weight: 700;
}

.track-section .card-header {
    background: var(--bg-muted);
}

.track-section-body {
    padding: 20px 24px 24px;
}

.track-prose {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.92rem;
}

.track-table tfoot td {
    background: var(--bg-muted);
    font-weight: 600;
    border-top: 2px solid var(--border);
}

.col-num {
    text-align: center;
    width: 90px;
}

.col-money {
    text-align: right;
    width: 120px;
    font-variant-numeric: tabular-nums;
}

.track-timeline {
    padding: 8px 24px 24px;
}

.track-timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    position: relative;
}

.track-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.track-timeline-marker {
    width: 12px;
    height: 12px;
    background: var(--inst-navy-mid);
    border: 2px solid var(--inst-gold-soft);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.track-timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.track-timeline-head strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.track-timeline-head time {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.track-timeline-change {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.track-timeline-change span {
    color: var(--inst-gold);
    margin: 0 4px;
}

.track-hint {
    display: flex;
    gap: 18px;
    padding: 24px;
    align-items: flex-start;
}

.track-hint-icon {
    width: 48px;
    height: 48px;
    background: var(--inst-gold-soft);
    color: #92700f;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-hint-icon svg {
    width: 24px;
    height: 24px;
}

.track-hint h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--inst-navy);
}

.track-hint p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.mono {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.88em;
    background: var(--bg-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

.ticket-input {
    text-transform: uppercase;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.05em;
}

.track-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
}

.track-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.track-footer-note {
    margin-top: 6px;
    font-size: 0.78rem !important;
}

/* Repair view — panel de estado */
.repair-status-panel {
    padding: 16px 22px 22px;
}

.repair-stepper {
    padding: 8px 0 16px;
}

.repair-stepper::before {
    left: 28px;
    right: 28px;
}

.repair-stepper .track-step-marker {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.repair-stepper .track-step-label {
    font-size: 0.65rem;
    max-width: 72px;
}

.repair-stepper-note {
    font-size: 0.8rem;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.repair-status-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.repair-cancel-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.repair-cancelled-banner {
    margin: 0 0 16px;
}

/* Customer card (repair sidebar) */
.customer-card .card-header {
    padding-top: 14px;
    padding-bottom: 14px;
}

.customer-card-body {
    padding: 4px 22px 20px;
}

.customer-fields {
    display: flex;
    flex-direction: column;
}

.customer-field {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.customer-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.customer-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.customer-field-value {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.55;
    word-break: break-word;
    text-align: left;
}

.customer-field-value.is-empty {
    color: var(--text-muted);
    font-style: italic;
}

.customer-field-mono {
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.02em;
}

.customer-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customer-edit-form input,
.customer-edit-form textarea,
.customer-edit-form select {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.customer-edit-form .form-group {
    gap: 5px;
}

.customer-edit-form label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.customer-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.customer-edit-actions .btn-primary {
    flex: 1;
}

@media (max-width: 768px) {
    .repair-stepper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 900px) {
    .track-search-fields {
        grid-template-columns: 1fr;
    }

    .track-search-action {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

/* Legacy public aliases (repair-view portal link) */
.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.public-header {
    background: var(--inst-navy);
    border-bottom: 3px solid var(--inst-gold);
    padding: 16px 20px;
}

.public-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-brand strong {
    display: block;
    font-size: 1.05rem;
    color: #fff;
}

.public-brand span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.public-main {
    flex: 1;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
}

.public-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.public-full-width {
    grid-column: 1 / -1;
}

.public-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.auth-public-link {
    margin-top: 12px;
}

.auth-public-link a {
    font-weight: 600;
}

/* Portal técnico */
.portal-card {
    border-color: rgba(26, 74, 114, 0.25);
    border-top: 3px solid var(--inst-gold);
}

.portal-info {
    padding: 16px 22px 22px;
}

.portal-ticket {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.portal-ticket span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.portal-ticket strong {
    font-family: 'Consolas', monospace;
    color: var(--accent);
}

.portal-url {
    margin-top: 12px;
    font-size: 0.8rem;
    word-break: break-all;
}

/* Security & audit */
.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 24px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.policy-note {
    padding: 0 0 8px;
    font-size: 0.85rem;
}

.security-links {
    padding: 8px 22px 22px;
}

.security-link-item {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: inherit;
}

.security-link-item:last-child {
    border-bottom: none;
}

.security-link-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.security-link-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.security-link-item:hover strong {
    color: var(--accent);
}

.audit-desc {
    max-width: 280px;
}

.nowrap {
    white-space: nowrap;
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .main-content {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .sidebar {
        width: min(100vw, 280px);
    }

    .track-topbar-row {
        padding: 10px 12px;
    }

    .track-login-btn {
        font-size: 0.72rem;
        padding: 7px 10px;
    }

    .track-search-panel {
        padding: 18px 16px;
        border-radius: var(--radius);
    }

    .track-panel-head {
        margin-bottom: 16px;
        padding-bottom: 14px;
    }

    .track-stepper {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: visible;
        padding: 12px 16px 8px;
    }

    .track-stepper::before {
        display: none;
    }

    .track-step {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }

    .track-step:last-child {
        border-bottom: none;
    }

    .track-step-label {
        max-width: none;
        font-size: 0.82rem;
        text-align: left;
    }

    .track-summary-top,
    .track-summary-badges {
        width: 100%;
    }

    .track-hint {
        flex-direction: column;
        padding: 18px 16px;
    }

    .customer-edit-actions {
        flex-direction: column;
    }

    .customer-edit-actions .btn {
        width: 100%;
    }

    .page-toolbar {
        gap: 10px;
    }

    .page-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .search-form .btn,
    .filters-form .btn {
        width: 100%;
    }
}
