/* ══════════════════════════════════════════════════════════
   İş Takip Paneli — Style v4 — Premium Dark Edition
   Focus: compact layout, rich hover, gradient accents
   ══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    /* Brand - Pen Pilates Mürdüm & Pudra */
    --primary: #80516a;
    --primary-dark: #5a364a;
    --primary-hover: #965e7d;
    --primary-light: #dfb5c9;
    --primary-subtle: rgba(223, 181, 201, 0.12);
    --primary-glow: rgba(223, 181, 201, 0.25);

    /* Backgrounds — clean layered dark */
    --bg-body: #0B0D12;
    --bg-sidebar: #0F1118;
    --bg-card: #151821;
    --bg-card-hover: #1A1E2A;
    --bg-input: #12151D;
    --bg-zebra: rgba(255, 255, 255, 0.018);

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.035);
    --border-focus: rgba(223, 181, 201, 0.45);

    /* Text — HIGH CONTRAST */
    --text-primary: #ECEEF4;
    --text-secondary: #9DA3B8;
    --text-muted: #5F6477;
    --text-inverse: #FFFFFF;

    /* Status — vivid */
    --success: #22D98E;
    --success-soft: rgba(34, 217, 142, 0.1);
    --warning: #FFB82E;
    --warning-soft: rgba(255, 184, 46, 0.1);
    --danger: #FF6B6B;
    --danger-soft: rgba(255, 107, 107, 0.1);
    --info: #5B9EFF;
    --info-soft: rgba(91, 158, 255, 0.1);

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border);
    --shadow-raised: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-popup: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(223, 181, 201, 0.15);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s var(--ease);
    --t-normal: 0.25s var(--ease);
    --t-slow: 0.35s var(--ease);

    /* Layout */
    --sidebar-w: 240px;
    --sidebar-mini: 68px;
}

/* ══════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════ */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92em;
    letter-spacing: -0.01em;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-right {
    text-align: right;
}

/* ── Links ── */
a.link {
    color: var(--primary-light);
    text-decoration: none;
    position: relative;
    transition: color var(--t-fast);
    font-weight: 500;
}

a.link:hover {
    color: #ffffff;
}

a.link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    border-radius: 1px;
    transition: width var(--t-normal);
}

a.link:hover::after {
    width: 100%;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 10%, rgba(223, 181, 201, 0.06) 0%, transparent 50%),
        var(--bg-body);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-popup), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-img {
    width: 180px;
    margin: 0 auto 18px;
    display: block;
    filter: drop-shadow(0 2px 12px rgba(223, 181, 201, 0.3));
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 0.02em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR — Gradient + Glassmorphism
   ══════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #111420 0%, #0A0C12 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform var(--t-slow), width var(--t-slow);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(223, 181, 201, 0.3) 0%,
            rgba(223, 181, 201, 0.05) 50%,
            transparent 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 20px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

.brand-logo {
    width: 140px;
    height: auto;
    transition: width var(--t-normal);
    filter: drop-shadow(0 2px 6px rgba(223, 181, 201, 0.2));
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13.5px;
    transition: all var(--t-fast);
    text-decoration: none;
    position: relative;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    transition: color var(--t-fast), transform var(--t-fast);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item:hover svg {
    color: var(--primary-light);
    transform: scale(1.08);
}

.nav-item.active {
    background: var(--primary-subtle);
    color: var(--text-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px var(--primary-glow);
}

.nav-item.active svg {
    color: var(--primary);
}

.sidebar-footer {
    padding: 10px 10px;
    border-top: 1px solid var(--border);
}

.nav-item-form {
    margin: 0;
}

.nav-item-form .nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.nav-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.nav-logout:hover svg {
    color: var(--danger);
    transform: scale(1.08);
}

/* ── Mobile ── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 40;
}

.hamburger {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hamburger svg {
    width: 22px;
    height: 22px;
}

.mobile-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 45;
}

.sidebar-overlay.active {
    display: block;
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT — Compact spacing
   ══════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 36px;
    transition: margin-left var(--t-slow);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 14px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.page-title-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(128, 81, 106, 0.32) 0%, rgba(223, 181, 201, 0.1) 100%);
    border: 1px solid rgba(223, 181, 201, 0.28);
    box-shadow: 0 4px 16px -2px rgba(128, 81, 106, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.page-title-icon-box svg {
    width: 22px;
    height: 22px;
    color: var(--primary-light);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.page-title-icon-box:hover {
    transform: translateY(-1px);
    border-color: rgba(223, 181, 201, 0.45);
    box-shadow: 0 6px 22px -2px rgba(128, 81, 106, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.page-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 40%, #dfb5c9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    line-height: 1.25;
}

.page-subtitle {
    font-size: 0.81rem;
    color: #8b95a8;
    font-weight: 450;
    letter-spacing: 0.015em;
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ══════════════════════════════════════════════════════════
   CARDS — Tight, clean
   ══════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    background: rgba(255, 255, 255, 0.012);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
    margin: 0;
}

.card-title-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    background: rgba(223, 181, 201, 0.12);
    border: 1px solid rgba(223, 181, 201, 0.2);
    color: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title-icon svg {
    width: 16px;
    height: 16px;
}

.card-title-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    margin-left: 4px;
}

.card-meta {
    font-size: 13px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS & DASHBOARD GRIDS
   ══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.dashboard-secondary-grid .card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-secondary-grid .card .table-responsive {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-secondary-grid .data-table {
    table-layout: fixed;
    width: 100%;
}

.dashboard-secondary-grid .data-table th,
.dashboard-secondary-grid .data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-secondary-grid .col-entity { width: 30%; }
.dashboard-secondary-grid .col-detail { width: 32%; }
.dashboard-secondary-grid .col-amount { width: 20%; }
.dashboard-secondary-grid .col-date   { width: 18%; }

@media (max-width: 1024px) {
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-raised);
    border-color: rgba(223, 181, 201, 0.15);
}

.stat-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.stat-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 20px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: transform var(--t-fast);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(-3deg);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ══════════════════════════════════════════════════════════
   DATA TABLES — Balanced columns, consistent alignment
   ══════════════════════════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}

.data-table thead th {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table thead th.text-right {
    text-align: right;
}

.data-table tbody tr {
    transition: all var(--t-fast);
}

.data-table tbody tr:nth-child(even) {
    background: var(--bg-zebra);
}

.data-table tbody tr:hover {
    background: rgba(223, 181, 201, 0.03) !important;
}

.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.data-table tbody td.text-right {
    text-align: right;
}

/* Clickable row */
.clickable-row {
    cursor: pointer;
}

.clickable-row td:first-child {
    position: relative;
}

.clickable-row:not([data-status]) td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--primary);
    transition: width var(--t-fast);
}

.clickable-row:not([data-status]):hover td:first-child::before {
    width: 3px;
}

.clickable-row:hover {
    background: rgba(223, 181, 201, 0.03) !important;
    box-shadow: inset 0 0 0 1px rgba(223, 181, 201, 0.06);
}

/* Status row accent — colored left border based on data-status */
tr[data-status="open"] td:first-child {
    border-left: 3px solid var(--warning);
}

tr[data-status="completed"] td:first-child {
    border-left: 3px solid var(--info);
}

tr[data-status="paid"] td:first-child {
    border-left: 3px solid var(--success);
}

.data-table td strong {
    font-weight: 600;
    color: var(--text-primary);
}

.data-table tfoot td {
    padding: 10px 14px;
    font-size: 13.5px;
    border-top: 2px solid var(--border);
}

.table-total-row td {
    font-weight: 700;
    color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   STATUS BADGES — Minimal dot + text
   ══════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-open {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-open::before {
    background: var(--warning);
}

.badge-completed {
    background: var(--info-soft);
    color: var(--info);
}

.badge-completed::before {
    background: var(--info);
}

.badge-paid {
    background: var(--success-soft);
    color: var(--success);
}

.badge-paid::before {
    background: var(--success);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-danger::before {
    background: var(--danger);
}

.badge-lg {
    padding: 5px 14px;
    font-size: 13px;
}

.badge-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-ghost::before {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS — Rich hover, glow effects
   ══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.3;
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid rgba(223, 181, 201, 0.2);
    box-shadow: 0 2px 10px rgba(128, 81, 106, 0.35);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    border-color: rgba(223, 181, 201, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(128, 81, 106, 0.5);
}

.btn-primary:active {
    background: var(--primary-dark);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(128, 81, 106, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: var(--primary-subtle);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--text-inverse);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 11px 24px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-danger-icon:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ══════════════════════════════════════════════════════════
   FORMS — Compact, clean
   ══════════════════════════════════════════════════════════ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group[hidden] {
    display: none;
}

.form-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label svg {
    width: 13px;
    height: 13px;
}

.form-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.4;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(223, 181, 201, 0.1), 0 0 12px rgba(223, 181, 201, 0.05);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23A3A8BC' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select-sm {
    padding: 7px 36px 7px 12px;
    font-size: 13px;
}

/* File upload — drag & drop zone */
.form-file {
    padding: 8px 12px;
}

.form-file::file-selector-button {
    background: var(--primary-subtle);
    color: var(--primary-light);
    border: 1px solid rgba(223, 181, 201, 0.25);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    margin-right: 12px;
    transition: all var(--t-fast);
}

.form-file::file-selector-button:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.upload-zone svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    margin: 0 auto 10px;
    transition: color var(--t-fast), transform var(--t-fast);
}

.upload-zone:hover svg {
    color: var(--primary-light);
    transform: translateY(-2px);
}

.upload-zone p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-browse {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-hint {
    font-size: 11.5px;
    color: var(--text-muted);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
}

.upload-file-name svg {
    width: 16px;
    height: 16px;
    color: var(--danger);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-col-half {
    flex: 1;
    min-width: 200px;
}

.form-col-third {
    flex: 1;
    min-width: 160px;
}

.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    background: rgba(255, 255, 255, 0.01);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}

.section-header h3 svg {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

/* Inline forms */
.inline-form {
    display: inline;
}

.inline-form-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form-row .form-input {
    flex: 1;
    min-width: 120px;
}

/* ── Filter bar — Compact single-line ── */
.filter-bar {
    margin-bottom: 16px;
}

.filter-form {
    padding: 12px 16px;
}

.filter-group {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group .form-group {
    min-width: 140px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ══════════════════════════════════════════════════════════
   JOB ITEMS (Create/Edit) — Card-style rows
   ══════════════════════════════════════════════════════════ */
.items-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px 36px;
    gap: 8px;
    padding: 0 12px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px 36px;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    animation: fadeInUp 0.3s var(--ease) both;
}

.item-row:hover {
    border-color: rgba(223, 181, 201, 0.15);
    box-shadow: 0 0 8px rgba(223, 181, 201, 0.05);
}

.item-row .form-input {
    padding: 8px 10px;
    font-size: 13px;
}

.items-table.has-products .items-header,
.items-table.has-products .item-row {
    grid-template-columns: 1.3fr 1.7fr 80px 115px 105px 36px;
    gap: 8px;
}

.item-product-select {
    color: var(--primary-light);
    font-weight: 600;
}

.item-line-total {
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    color: var(--text-primary);
}

.items-footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 12px 0;
    font-size: 16px;
    font-weight: 700;
    border-top: 2px solid var(--border);
    margin-top: 8px;
}

.items-footer .mono {
    background: linear-gradient(135deg, var(--primary-light), #eed4e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Add item button area */
.add-item-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    gap: 6px;
}

.add-item-area:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: var(--primary-subtle);
}

.add-item-area svg {
    width: 16px;
    height: 16px;
}

/* ══════════════════════════════════════════════════════════
   CUSTOMER CARDS — Rich card-based list
   ══════════════════════════════════════════════════════════ */
.customer-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
}

.customer-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--primary);
    transition: width var(--t-fast);
}

.customer-card:hover {
    border-color: rgba(223, 181, 201, 0.25);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 16px rgba(223, 181, 201, 0.06);
    transform: translateX(2px);
}

.customer-card:hover::before {
    width: 3px;
}

.customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(223, 181, 201, 0.25);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.customer-card:hover .customer-avatar {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(223, 181, 201, 0.35);
}

.customer-avatar svg {
    width: 22px;
    height: 22px;
}

.customer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.customer-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-phone {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.customer-phone svg {
    width: 12px;
    height: 12px;
}

.customer-stats {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.customer-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    min-width: 52px;
}

.customer-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.customer-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.customer-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

.customer-date svg {
    width: 13px;
    height: 13px;
}

.customer-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: all var(--t-fast);
}

.customer-arrow svg {
    width: 16px;
    height: 16px;
}

.customer-card:hover .customer-arrow {
    color: var(--primary-light);
    transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════
   DETAIL PAGE LAYOUT
   ══════════════════════════════════════════════════════════ */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.detail-grid > * {
    min-width: 0;
}

/* -- Detail Header Card overrides -- */
.detail-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-title-row .card-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.detail-meta {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-meta svg {
    width: 14px;
    height: 14px;
}

.detail-description {
    padding: 16px 24px 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.detail-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    align-items: center;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}

/* When card-header is inside a detail page card, make it roomier */
.detail-main>.card:first-child .card-header {
    padding: 20px 24px;
    gap: 14px;
}

/* ── Summary Card ── */
.summary-card {
    padding: 24px;
    position: sticky;
    top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.summary-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 13.5px;
}

.summary-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.summary-row-highlight .summary-value {
    font-size: 22px;
}

/* ── Progress ── */
.progress-indicator {
    margin-top: 18px;
    text-align: center;
}

.progress-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.8s ease;
}

.progress-pct {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Files ── */
.file-list {
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: all var(--t-fast);
}

.file-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(223, 181, 201, 0.08);
}

.file-icon {
    width: 18px;
    height: 18px;
    color: var(--danger);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Upload progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.2s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 32px;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 16px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid rgba(34, 217, 142, 0.25);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-soft);
    border: 1px solid rgba(255, 107, 107, 0.25);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-soft);
    border: 1px solid rgba(255, 184, 46, 0.25);
    color: var(--warning);
}

.alert-info {
    background: var(--info-soft);
    border: 1px solid rgba(91, 158, 255, 0.25);
    color: var(--info);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    padding: 4px;
    cursor: pointer;
    transition: opacity var(--t-fast);
}

.alert-close:hover {
    opacity: 1;
}

.alert-close svg {
    width: 15px;
    height: 15px;
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE — Illustrative
   ══════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--text-muted);
    opacity: 0.4;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14.5px;
    color: var(--text-secondary);
}

.empty-state .btn {
    margin-top: 4px;
}

.empty-state-sm {
    text-align: center;
    padding: 28px;
    color: var(--text-muted);
    font-size: 13.5px;
}

/* ══════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

/* (Toast rules handled by Enhanced Toast Notification Engine at the bottom of stylesheet) */

/* ══════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════ */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 100;
}

.modal-backdrop.active {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popup);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
}

.modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
}

.unsaved-changes-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(92vw, 460px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: auto;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popup), 0 0 40px rgba(128, 81, 106, 0.2);
}

.unsaved-changes-dialog:not([open]) { display: none; }
.unsaved-changes-dialog::backdrop { background: rgba(5, 7, 12, 0.78); backdrop-filter: blur(6px); }
.unsaved-changes-content { padding: 28px; }
.unsaved-changes-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 18px;
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid rgba(255, 184, 46, 0.22);
    border-radius: var(--radius-md);
    font-size: 20px;
    font-weight: 800;
}
.unsaved-changes-eyebrow {
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.unsaved-changes-content h3 { margin: 7px 0 8px; font-size: 20px; line-height: 1.3; }
.unsaved-changes-content p { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.unsaved-changes-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.unsaved-changes-actions .btn { min-height: 40px; }

@media (max-width: 560px) {
    .unsaved-changes-content { padding: 22px; }
    .unsaved-changes-actions { flex-direction: column; }
    .unsaved-changes-actions .btn { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.animate-in {
    animation: fadeInUp 0.2s var(--ease) both;
}

.shake-animate {
    animation: shake 0.5s ease;
}

/* Pulse for open status dot */
.badge-open::before {
    animation: pulse-dot 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Comprehensive Mobile-First Overhaul
   Breakpoints: 1200px (tablet), 768px (mobile), 480px (small)
   ══════════════════════════════════════════════════════════ */

/* ── Touch-friendly targets ── */
@media (pointer: coarse) {

    .btn,
    .nav-item,
    .pagination-link {
        min-height: 44px;
    }

    .btn-icon {
        min-height: 40px;
        min-width: 40px;
        padding: 10px;
    }

    .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }
}

/* ══ TABLET — 1200px ══ */
@media (max-width: 1200px) {
    .sidebar {
        width: var(--sidebar-mini);
    }

    .nav-label {
        display: none;
    }

    .sidebar-brand {
        padding: 20px 8px;
    }

    .brand-logo {
        width: 40px;
    }

    .nav-item {
        justify-content: center;
        padding: 11px;
    }

    .main-content {
        margin-left: var(--sidebar-mini);
        padding: 24px 20px;
    }

    /* Detail page (job show, customer show) → single column */
    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 100%;
    }

    .detail-sidebar {
        order: -1;
        max-width: 100%;
    }

    .detail-main {
        max-width: 100%;
        overflow: hidden;
    }

    .summary-card {
        position: static;
        max-width: 100%;
    }

    .card {
        max-width: 100%;
    }

    /* Stats → 3 cols still fits on tablet */
    .stats-grid {
        gap: 12px;
    }
}

/* ══ MOBILE — 768px ══ */
@media (max-width: 768px) {

    /* ── Sidebar: off-canvas drawer ── */
    .sidebar {
        width: var(--sidebar-w);
        transform: translateX(-100%);
        position: fixed;
        z-index: 50;
        transition: transform 0.3s var(--ease);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .nav-label {
        display: inline;
    }

    .sidebar-brand {
        padding: 24px 16px;
    }

    .brand-logo {
        width: 140px;
    }

    .nav-item {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    /* ── Mobile header bar ── */
    .mobile-header {
        display: flex;
    }

    /* ── Main content area ── */
    .main-content {
        margin-left: 0;
        padding: 16px 12px;
        padding-top: 68px;
        overflow-x: hidden;
    }

    /* ── Topbar ── */
    .topbar {
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .topbar-right .btn-sm {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* ── Stat Cards → 2 per row ── */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-body {
        padding: 16px 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    /* ── Cards ── */
    .card {
        border-radius: var(--radius-sm);
        margin-bottom: 14px;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-title {
        font-size: 13.5px;
    }

    .card-footer {
        padding: 12px 14px;
    }

    /* ── Data Tables — scrollable on mobile ── */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table thead th {
        padding: 10px 12px;
        font-size: 10px;
        white-space: nowrap;
    }

    .data-table tbody td {
        padding: 11px 12px;
        font-size: 12.5px;
    }

    /* ── Customer Cards — wrap on mobile ── */
    .customer-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px;
    }

    .customer-avatar {
        width: 36px;
        height: 36px;
    }

    .customer-avatar svg {
        width: 18px;
        height: 18px;
    }

    .customer-info {
        flex: 1;
        min-width: 0;
    }

    .customer-name {
        font-size: 13.5px;
    }

    .customer-stats {
        width: 100%;
        order: 3;
        justify-content: flex-start;
    }

    .customer-stat {
        flex: 1;
        min-width: 0;
        padding: 6px 10px;
    }

    .customer-stat-value {
        font-size: 14px;
    }

    .customer-date {
        font-size: 11px;
    }

    .customer-arrow {
        display: none;
    }

    /* ── Filter Bar ── */
    .filter-form {
        padding: 10px 12px;
    }

    .filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group .form-group {
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* ── Inline Form Row (payment add etc.) ── */
    .inline-form-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .inline-form-row .form-input {
        max-width: 100% !important;
        min-width: 100%;
    }

    .inline-form-row .btn {
        width: 100%;
        justify-content: center;
    }

    .inline-form-row .checkbox-label {
        justify-content: flex-start;
    }

    /* ── Forms ── */
    .form-stack {
        padding: 16px 14px !important;
    }

    .form-row {
        flex-direction: column;
    }

    .form-col-half,
    .form-col-third {
        min-width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Detail Page ── */
    .detail-grid {
        gap: 12px;
    }

    .detail-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .detail-title-row .card-title {
        font-size: 16px;
    }

    .detail-meta {
        flex-wrap: wrap;
        gap: 6px 14px;
        font-size: 12px;
        padding: 12px 14px;
    }

    .detail-description {
        padding: 12px 14px;
        font-size: 13px;
    }

    .detail-actions {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 14px;
    }

    .detail-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: calc(50% - 4px);
        font-size: 12px;
        padding: 8px 12px;
    }

    .detail-main>.card:first-child .card-header {
        padding: 14px;
    }

    /* ── Summary Card (financial sidebar) ── */
    .summary-card {
        padding: 16px;
        overflow: hidden;
    }

    .summary-title {
        margin-bottom: 14px;
        font-size: 10px;
    }

    .summary-row {
        padding: 8px 0;
    }

    .summary-label {
        font-size: 12.5px;
        flex-shrink: 0;
    }

    .summary-value {
        font-size: 13px;
        text-align: right;
        word-break: break-all;
    }

    .summary-row-highlight .summary-value {
        font-size: 18px;
    }

    .progress-indicator {
        margin-top: 12px;
    }

    /* ── Job Items (create/edit form) ── */
    .items-header {
        display: none;
    }

    .item-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .items-table.has-products .item-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .item-row > * {
        min-width: 0;
    }

    .item-row .form-input:first-child,
    .items-table.has-products .item-row .item-product-select,
    .items-table.has-products .item-row .item-desc {
        grid-column: 1 / -1;
    }

    .item-line-total {
        grid-column: 1 / -1;
        text-align: right;
        padding-top: 4px;
        border-top: 1px solid var(--border-subtle);
    }

    .item-row .remove-item-btn {
        position: static;
        justify-self: end;
        grid-column: 1 / -1;
    }

    .item-row {
        position: relative;
    }

    /* ── Modals ── */
    .modal {
        width: calc(100vw - 24px);
        max-width: 400px;
    }

    .modal .form-stack {
        padding: 20px !important;
    }

    /* ── Toasts ── */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast {
        max-width: 100%;
    }

    /* ── Upload Zone ── */
    .upload-zone {
        padding: 24px 16px;
    }

    /* ── Pagination ── */
    .pagination {
        flex-wrap: wrap;
    }

    .pagination-link {
        min-width: 36px;
        min-height: 36px;
    }

    /* ── Empty State ── */
    .empty-state {
        padding: 32px 16px;
    }

    .empty-state svg {
        width: 36px;
        height: 36px;
    }

    /* ── Alerts / Flash ── */
    .alert {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* ── Performance: disable hover effects on touch ── */
    .stat-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .stat-card:hover .stat-icon {
        transform: none;
    }

    .clickable-row:hover {
        box-shadow: none;
    }

    /* Disable animations for performance on mobile */
    .animate-in {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ══ SMALL MOBILE — 480px ══ */
@media (max-width: 480px) {

    /* ── Stat Cards → single column ── */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-body {
        padding: 14px 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* ── Main content tighter ── */
    .main-content {
        padding: 12px 8px;
        padding-top: 64px;
    }

    /* ── Page title ── */
    .page-title {
        font-size: 16px;
    }

    /* ── Cards tighter ── */
    .card-header {
        padding: 10px 12px;
    }

    .card-footer {
        padding: 10px 12px;
    }

    .card-title {
        font-size: 13px;
    }

    /* ── Data table even tighter ── */
    .data-table thead th {
        padding: 8px 10px;
        font-size: 9px;
    }

    .data-table tbody td {
        padding: 10px 10px;
        font-size: 12px;
    }

    /* ── Job items → full stack ── */
    .item-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 10px;
    }

    .items-table.has-products .item-row {
        grid-template-columns: minmax(0, 1fr);
    }

    /* ── Topbar ── */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .topbar-right {
        width: 100%;
    }

    .topbar-right .btn {
        flex: 1;
        justify-content: center;
    }

    /* ── Detail actions → full width buttons ── */
    .detail-actions .btn {
        min-width: 100%;
    }

    /* ── Modals fullscreen-ish ── */
    .modal {
        width: calc(100vw - 16px);
    }

    .modal .form-stack {
        padding: 16px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   GRID UTILITIES
   ══════════════════════════════════════════════════════════ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ══════════════════════════════════════════════════════════
   TABLE SCROLL INDICATORS — subtle gradient shadows
   ══════════════════════════════════════════════════════════ */
.table-responsive {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Minimum width for tables to prevent column crushing */
.table-responsive .data-table {
    min-width: 600px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Grid utilities per breakpoint
   ══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1200px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Sidebar safe-area — notched phones */
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-header {
        padding-top: env(safe-area-inset-top, 0);
    }

    /* Main content safe-area */
    .main-content {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
    }

    /* Topbar — always stack on mobile */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topbar-right {
        width: 100%;
    }

    .topbar-right .btn {
        flex: 1;
        justify-content: center;
    }

    /* Report summary strip — vertical on mobile */
    .report-summary {
        flex-direction: column;
        gap: 8px;
        padding: 14px 16px;
    }

    .report-summary-divider {
        width: 100%;
        height: 1px;
    }

    .report-summary-item {
        min-width: unset;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        width: 100%;
    }

    .report-summary-label {
        margin-bottom: 0;
    }

    .report-summary-value {
        font-size: 15px;
        white-space: nowrap;
    }

    /* Report toggle — smaller on mobile */
    .report-toggle-btn {
        padding: 5px 10px;
        font-size: 11.5px;
    }

    /* Chart heights — prevent too-tall charts on mobile */
    #mainChart {
        height: 280px !important;
    }

    #chart2,
    #chart3,
    #chart4 {
        height: 260px !important;
    }

    /* Table: ensure minimum width on data tables */
    .table-responsive .data-table {
        min-width: 520px;
    }

    /* Payment/filter forms inline inputs full width */
    .filter-form .form-input,
    .filter-form .form-select {
        min-width: 100%;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .report-summary-value {
        font-size: 14px;
    }

    #mainChart {
        height: 240px !important;
    }

    #chart2,
    #chart3,
    #chart4 {
        height: 220px !important;
    }

    /* Full-width report toggle */
    .report-toggle {
        width: 100%;
    }

    .report-toggle-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==========================================================================
   Centralized presentation styles (moved from view inline attributes/blocks)
   ========================================================================== */
/* Centralized styles from layout.php */
body:not(.login-page){opacity:0}body:not(.login-page).ready{opacity:1;transition:opacity 0.08s ease}
/* Centralized styles from index.php */
.report-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.report-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.report-toggle-btn:hover { color: var(--text-primary); }
.report-toggle-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.report-summary {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.report-summary-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 4px 12px;
}
.report-summary-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.report-summary-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.report-summary-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .report-summary { flex-direction: column; gap: 0; padding: 12px 16px; }
    .report-summary-divider { width: 100%; height: 1px; }
    .report-summary-item {
        min-width: unset;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 8px 0;
        width: 100%;
    }
    .report-summary-label { margin-bottom: 0; font-size: 12px; }
    .report-summary-value { font-size: 15px; white-space: nowrap; margin-left: auto; }
    .report-toggle-btn { padding: 5px 10px; font-size: 11.5px; }
}

@media (min-width: 769px) and (max-width: 1400px) {
    .report-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 0;
        padding: 16px;
    }

    .report-summary-divider {
        display: none;
    }

    .report-summary-item {
        min-width: 0;
    }

    .report-summary-value {
        white-space: nowrap;
        font-size: clamp(14px, 1.4vw, 18px);
    }
}

.u-s002092e04a { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; }
/* Filter PDF button: as wide as the button, right next to the last field. */
.filter-group .form-group.u-s002092e04a { min-width: 0; align-self: flex-end; }

.u-s006a6141a1 { width:9% }

.u-s017d29aa9d { padding-top:6px; padding-bottom:6px; height:auto; min-height:0; width:auto; font-size:13px; font-weight:600; cursor:pointer; }

.u-s07de5a5faa { display:flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--text-muted) }

.u-s0ee314e602 { width:18px;height:18px;accent-color:var(--primary);cursor:pointer; }

.u-s1ad9a81b1b { width:25% }

.u-s1ae3021aff { width: 48px; height: 48px; color: var(--border-color); margin-bottom: 16px; }

.u-s1bc01bbfb5 { animation-delay: 360ms }

.u-s21e8bb66a9 { max-width:160px }

.u-s23984e735d { width:15% }

.u-s27231daefd { display:flex; align-items:center; gap:8px; }

.u-s29fdd27957 { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }

.u-s2fd61402b1 { height:44px; font-size:13px }

.u-s3088da1131 { display: flex; align-items: center; gap: 8px; }

.u-s39aa76448c { animation-delay: 240ms }

.u-s3a4f63b7c2 { width:28% }

.u-s3b920d1604 { width:48px;height:48px;border-radius:50%;background:var(--danger-soft);display:inline-flex;align-items:center;justify-content:center;margin-bottom:16px }

.u-s3ee9c75f38 { width:24px;height:24px;color:var(--primary-light) }

.u-s3fa4747b58 { animation-delay: 180ms }

.u-s42e4acca13 { display:flex; align-items:center; gap:8px }

.u-s433de30b36 { font-size:14px }

.u-s44b21af70c { width:20% }

.u-s48e9c2c1cd { display: flex; flex-direction: column; gap: 0.5rem; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.u-s48f8422a7b { color:var(--text-secondary);font-size:13.5px }

.u-s49f14f8f83 { margin-bottom:20px }

.u-s4e7b61f8ff { font-size:12px;color:var(--text-muted);font-weight:400 }

.u-s4fc135e434 { padding: 1rem; border-top: 1px solid var(--border-light); }

.u-s4ff818ffe1 { font-size:18px }

.u-s53095fe205 { animation-delay:50ms }

.u-s53d332dee4 { width:14px;height:14px }

.u-s55b2e17218 { width:18% }

.u-s5db8347ca2 { width:6% }

.u-s5e44d17143 { font-size:16px;font-weight:700;margin-bottom:8px }

.u-s5e478e9b41 { padding:0 0 12px 0; border-bottom:none }

.u-s6154e443b6 { gap:20px; margin-bottom:20px }

.u-s6507549c62 { width:auto; min-width:90px; padding:6px 10px; font-size:13px; display:none }

.u-s674503194f { align-items:flex-end; margin-bottom:0 }

.u-s6750b23420 { font-size:12.5px }

.u-s67fc79cb2b { display:flex;gap:10px;justify-content:center;margin-top:8px }

.u-s685698ccfc { font-size:13px; cursor:pointer; color:var(--text-light); font-weight:500; display:flex; align-items:center; gap:6px; margin-bottom:0; z-index:10; }

.u-s6949bd1717 { animation-delay: 60ms }

.u-s6a9c8533cf { max-width: 560px }

.u-s6b99de8b69 { display:none }

.u-s6bbafabf21 { width:11% }

.u-s6cb285c61d { font-size:12px }

.u-s6cf2125ad2 { width:38% }

.u-s7144b4832d { width:48px;height:48px;border-radius:50%;background:var(--primary-subtle);display:inline-flex;align-items:center;justify-content:center;margin-bottom:16px }

.u-s727ad044fb { justify-content:space-between; align-items:center; }

.u-s72bd576b5c { display: flex; gap: 8px; margin-top: 24px; }

.u-s7b6d1cb818 { margin-top: 4px; font-size: 0.85rem; color: var(--text-muted); }

.u-s7b6e5e0d8e { margin:0; font-size:20px }

.u-s7e15569273 { animation-delay:60ms }

.u-s816b158dbc { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:12px }

.u-s826452a9ea { background:#f1f5f9; color:#64748b; font-size:11px; margin-left:4px; }

.u-s8583a783ce { width:16px;height:16px; }

.u-s86abdab991 { white-space:nowrap }

.u-s8c69c0456b { width:21% }

.u-s8c8f533b00 { width:8% }

.u-s8cadba3a61 { font-size:12px; color:var(--text-muted) }

.u-s91a87015f4 { text-align:center }

.u-s933a8ef29e { font-size: 0.85rem; }

.u-s9618062e19 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.u-s97445a8d93 { flex:1 }

.u-s9b9e3d1dc5 { display:flex;align-items:center;gap:8px;font-size:14px;cursor:pointer;font-weight:500; }

.u-s9ce9ae9d43 { width:4% }

.u-s9ee85c5c3f { animation-delay: 120ms }

.u-sa0155ba14f { background: var(--primary); }

.u-sa19bf6120d { padding:40px }

.u-sa1c8eab94a { width:16px;height:16px }

.u-sa3394b7576 { gap: 1.5rem; }

.u-sa428bafc27 { font-size: 15px }

.u-sab55ca219a { font-size:16px;font-weight:700;margin-bottom:16px }

.u-sace143b7c0 { border-bottom: 1px solid var(--border-light) }

.u-sb2f3e3b974 { accent-color:var(--primary); }

.u-sb52608060a { width: 100%; justify-content: center; }

.u-sb87ca3241d { display:flex;align-items:center;gap:10px }

.u-sbb66c912af { animation-delay: 60ms; }

.u-sc28f1b1511 { width:12% }

.u-sc2bcea0858 { display: flex; justify-content: space-between; align-items: center; }

.u-sc2e49e3456 { width:22% }

.u-sc34a167027 { display:none; gap:10px; flex-direction:column; }

.u-sc66ff2c048 { width:30% }

.u-sc9a7335caf { display: flex; align-items: center; gap: 16px; }

.u-sca83a7bc1d { width:24px;height:24px;color:var(--danger) }

.u-scad980f4b7 { width:100%; }

.u-sd265a6b9b9 { margin-top: 16px; }

.u-sd65100f7e4 { margin-top: -4px; }

.u-sd7fdaf1867 { font-weight: 600; font-size: 1.05rem; }

.u-sdc2e428fc7 { color:var(--primary) }

.u-sdc39b8f5d6 { width:40% }

.u-sdc6b6e96b4 { padding: 28px }

.u-se03ca4a2c8 { animation-delay: 300ms }

.u-se3061b6c8e { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }

.u-se3bda251e8 { width:24% }

.u-se41405c953 { font-size: 13.5px }

.u-se443947486 { background:#f1f5f9; color:#64748b; font-size:11px; vertical-align:middle; }

.u-se5d6bae933 { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }

.u-se63f1e231e { font-size:15px; }

.u-se711c1eba5 { height:300px }

.u-se91a94013f { height:340px }

.u-se995ee2fab { width:13% }

.u-sea987ae7da { background:var(--border-light); color:var(--text-main); }

.u-sec006093a7 { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:0.5rem; }

.u-seed0f8fb89 { font-weight:600 }

.u-sef0b7a1148 { margin-bottom:0 }

.u-sef3809e728 { width:23% }

.u-sef591f2aec { font-size:13.5px; }

.u-sf267e3ca68 { margin-bottom: 1rem; }

.u-sf8f920ca73 { display:inline-block; margin-bottom:0; }

.u-sfd14ca83c7 { width:14% }

.u-sfd3867848e { width:50% }

.u-sfdf20b9a58 { padding:12px 16px }

.u-sfe54514efd { max-width:250px }

.u-sffe23b7ae4 { width:16% }

/* Centralized state and utility styles. Keep view markup free of inline CSS. */
.is-hidden { display: none !important; }
.body-no-scroll { overflow: hidden; }
.is-search-loading { opacity: 0.5; transition: opacity 0.15s ease; }
.is-removing { opacity: 0; transform: translateX(20px); }
.toast.is-dismissing { opacity: 0; transform: translateX(100%); }
.alert.is-dismissing { opacity: 0; transform: translateY(-10px); }
.is-report-loading { opacity: 0.3; transition: opacity 0.2s ease; }
.report-chart-mobile { height: 320px !important; }
.report-year-select { width: auto; min-width: 90px; padding: 6px 10px; font-size: 13px; }
.is-login-locked { pointer-events: none; opacity: 0.5; }
.form-inline-zero { margin: 0; }
.report-pdf-form { padding: 20px; }
.proposal-pdf-link { font-weight: 600; font-size: 1.05rem; }
.proposal-archive-action { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 11px; }
.u-height-38 { height: 38px; }
.u-margin-right-4 { margin-right: 4px; }
.u-flex-fill-center { flex: 1; justify-content: center; }
.u-flex-fill-action { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; border-radius: 6px; font-weight: 500; }
.u-max-width-155 { max-width: 155px; }
.u-width-full { width: 100%; }
.input-readonly,
.form-input:disabled { background-color: var(--bg-hover); color: var(--text-muted); opacity: 0.8; }
.kdv-toggle-input,
.proposal-kdv-toggle,
.proposal-unregistered-toggle { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.kdv-summary-row { font-size: 13.5px; }
.customer-area-registered { display: block; }
.customer-area-unregistered { display: none; gap: 10px; flex-direction: column; }
.customer-area-unregistered.is-visible { display: flex; }
.select2-container.is-hidden { display: none !important; }
.upload-file-name.is-visible,
.upload-progress.is-visible { display: flex; }
.progress-fill { width: 0%; }
.progress-fill.upload-width-0 { width: 0%; }
.progress-fill.upload-width-1 { width: 1%; }
.progress-fill.upload-width-2 { width: 2%; }
.progress-fill.upload-width-3 { width: 3%; }
.progress-fill.upload-width-4 { width: 4%; }
.progress-fill.upload-width-5 { width: 5%; }
.progress-fill.upload-width-6 { width: 6%; }
.progress-fill.upload-width-7 { width: 7%; }
.progress-fill.upload-width-8 { width: 8%; }
.progress-fill.upload-width-9 { width: 9%; }
.progress-fill.upload-width-10 { width: 10%; }
.progress-fill.upload-width-11 { width: 11%; }
.progress-fill.upload-width-12 { width: 12%; }
.progress-fill.upload-width-13 { width: 13%; }
.progress-fill.upload-width-14 { width: 14%; }
.progress-fill.upload-width-15 { width: 15%; }
.progress-fill.upload-width-16 { width: 16%; }
.progress-fill.upload-width-17 { width: 17%; }
.progress-fill.upload-width-18 { width: 18%; }
.progress-fill.upload-width-19 { width: 19%; }
.progress-fill.upload-width-20 { width: 20%; }
.progress-fill.upload-width-21 { width: 21%; }
.progress-fill.upload-width-22 { width: 22%; }
.progress-fill.upload-width-23 { width: 23%; }
.progress-fill.upload-width-24 { width: 24%; }
.progress-fill.upload-width-25 { width: 25%; }
.progress-fill.upload-width-26 { width: 26%; }
.progress-fill.upload-width-27 { width: 27%; }
.progress-fill.upload-width-28 { width: 28%; }
.progress-fill.upload-width-29 { width: 29%; }
.progress-fill.upload-width-30 { width: 30%; }
.progress-fill.upload-width-31 { width: 31%; }
.progress-fill.upload-width-32 { width: 32%; }
.progress-fill.upload-width-33 { width: 33%; }
.progress-fill.upload-width-34 { width: 34%; }
.progress-fill.upload-width-35 { width: 35%; }
.progress-fill.upload-width-36 { width: 36%; }
.progress-fill.upload-width-37 { width: 37%; }
.progress-fill.upload-width-38 { width: 38%; }
.progress-fill.upload-width-39 { width: 39%; }
.progress-fill.upload-width-40 { width: 40%; }
.progress-fill.upload-width-41 { width: 41%; }
.progress-fill.upload-width-42 { width: 42%; }
.progress-fill.upload-width-43 { width: 43%; }
.progress-fill.upload-width-44 { width: 44%; }
.progress-fill.upload-width-45 { width: 45%; }
.progress-fill.upload-width-46 { width: 46%; }
.progress-fill.upload-width-47 { width: 47%; }
.progress-fill.upload-width-48 { width: 48%; }
.progress-fill.upload-width-49 { width: 49%; }
.progress-fill.upload-width-50 { width: 50%; }
.progress-fill.upload-width-51 { width: 51%; }
.progress-fill.upload-width-52 { width: 52%; }
.progress-fill.upload-width-53 { width: 53%; }
.progress-fill.upload-width-54 { width: 54%; }
.progress-fill.upload-width-55 { width: 55%; }
.progress-fill.upload-width-56 { width: 56%; }
.progress-fill.upload-width-57 { width: 57%; }
.progress-fill.upload-width-58 { width: 58%; }
.progress-fill.upload-width-59 { width: 59%; }
.progress-fill.upload-width-60 { width: 60%; }
.progress-fill.upload-width-61 { width: 61%; }
.progress-fill.upload-width-62 { width: 62%; }
.progress-fill.upload-width-63 { width: 63%; }
.progress-fill.upload-width-64 { width: 64%; }
.progress-fill.upload-width-65 { width: 65%; }
.progress-fill.upload-width-66 { width: 66%; }
.progress-fill.upload-width-67 { width: 67%; }
.progress-fill.upload-width-68 { width: 68%; }
.progress-fill.upload-width-69 { width: 69%; }
.progress-fill.upload-width-70 { width: 70%; }
.progress-fill.upload-width-71 { width: 71%; }
.progress-fill.upload-width-72 { width: 72%; }
.progress-fill.upload-width-73 { width: 73%; }
.progress-fill.upload-width-74 { width: 74%; }
.progress-fill.upload-width-75 { width: 75%; }
.progress-fill.upload-width-76 { width: 76%; }
.progress-fill.upload-width-77 { width: 77%; }
.progress-fill.upload-width-78 { width: 78%; }
.progress-fill.upload-width-79 { width: 79%; }
.progress-fill.upload-width-80 { width: 80%; }
.progress-fill.upload-width-81 { width: 81%; }
.progress-fill.upload-width-82 { width: 82%; }
.progress-fill.upload-width-83 { width: 83%; }
.progress-fill.upload-width-84 { width: 84%; }
.progress-fill.upload-width-85 { width: 85%; }
.progress-fill.upload-width-86 { width: 86%; }
.progress-fill.upload-width-87 { width: 87%; }
.progress-fill.upload-width-88 { width: 88%; }
.progress-fill.upload-width-89 { width: 89%; }
.progress-fill.upload-width-90 { width: 90%; }
.progress-fill.upload-width-91 { width: 91%; }
.progress-fill.upload-width-92 { width: 92%; }
.progress-fill.upload-width-93 { width: 93%; }
.progress-fill.upload-width-94 { width: 94%; }
.progress-fill.upload-width-95 { width: 95%; }
.progress-fill.upload-width-96 { width: 96%; }
.progress-fill.upload-width-97 { width: 97%; }
.progress-fill.upload-width-98 { width: 98%; }
.progress-fill.upload-width-99 { width: 99%; }
.progress-fill.upload-width-100 { width: 100%; }

/* Inventory / cost management */
.inventory-shell { display:flex; flex-direction:column; gap:24px; }
.inventory-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.inventory-intro h2 { margin:6px 0 6px; font-size:28px; letter-spacing:-.03em; }
.inventory-intro p { margin:0; color:var(--text-muted); }
.inventory-intro-actions,.inventory-report-actions,.bom-actions,.inventory-detail-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.eyebrow { display:inline-flex; align-items:center; gap:7px; color:#8f9bb6; font-size:10px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.eyebrow svg { width:13px; height:13px; color:var(--primary-light); }
.inventory-stats,.inventory-detail-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.inventory-stat-card,.inventory-detail-stat { min-width:0; padding:18px; background:linear-gradient(140deg,rgba(37,30,37,.95),rgba(24,20,25,.98)); border:1px solid rgba(223,181,201,.14); border-radius:14px; display:flex; align-items:center; gap:13px; box-shadow:0 8px 22px rgba(0,0,0,.12); }
.inventory-stat-card small,.inventory-detail-stat small { display:block; color:#bba8b4; font-size:11px; font-weight:700; margin-bottom:7px; }
.inventory-stat-card strong,.inventory-detail-stat strong { display:block; color:#f1f4fb; font-size:20px; line-height:1.1; }
.inventory-stat-icon { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; color:var(--primary-light); background:var(--primary-subtle); border-radius:11px; }
.inventory-stat-icon svg { width:21px; height:21px; }
.inventory-stat-icon.is-green { color:#2ed991; background:rgba(46,217,145,.11); }.inventory-stat-icon.is-yellow { color:#ffba42; background:rgba(255,186,66,.11); }.inventory-stat-icon.is-red { color:#ff6b73; background:rgba(255,107,115,.11); }
.inventory-toolbar { padding:14px; display:flex; justify-content:space-between; align-items:center; gap:18px; flex-wrap:wrap; }
.inventory-tabs { display:flex; gap:4px; padding:4px; background:rgba(20,17,21,.85); border:1px solid rgba(223,181,201,.12); border-radius:10px; }
.inventory-tab { padding:9px 13px; color:#c2b2bc; font-size:12px; font-weight:700; border-radius:7px; text-decoration:none; }
.inventory-tab:hover,.inventory-tab.is-active { color:#f2f5fb; background: rgba(223, 181, 201, 0.12); border-color: rgba(223, 181, 201, 0.35); }
.inventory-filter-form { display:flex; gap:8px; align-items:center; flex:1; justify-content:flex-end; }
.inventory-search { display:flex; align-items:center; gap:8px; min-width:220px; padding:0 11px; height:36px; color:#b09ea9; background:rgba(20,17,21,.85); border:1px solid rgba(223,181,201,.14); border-radius:8px; }
.inventory-search svg { width:15px; }.inventory-search input { width:100%; border:0; outline:0; color:var(--text-primary); background:transparent; font-size:12px; }
.inventory-section { display:flex; flex-direction:column; gap:13px; }.inventory-section-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; }.inventory-section-heading h3 { margin:4px 0 0; font-size:18px; }.inventory-section-heading .link { display:inline-flex; gap:5px; align-items:center; font-size:12px; }.inventory-section-heading .link svg { width:14px; }
.product-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.product-card { overflow:hidden; background:linear-gradient(150deg,rgba(35,28,35,.95),rgba(22,18,23,.98)); border:1px solid rgba(223,181,201,.14); border-radius:15px; }
.product-card-photo { width:100%; height:124px; display:block; object-fit:contain; padding:6px; border-bottom:1px solid rgba(223,181,201,.12); background:linear-gradient(180deg,rgba(30,24,30,.9),rgba(18,15,19,.95)); }.product-card-placeholder { display:grid; place-items:center; color:var(--primary-light); background:rgba(128,81,106,.15); }.product-card-placeholder svg { width:35px; height:35px; }
.product-card-body { padding:15px; }.product-card-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }.product-card-title h4 { margin:0; font-size:17px; }.product-card-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:18px 0 12px; }.product-card-metrics small,.product-card-metrics strong { display:block; }.product-card-metrics small { color:#b8a5b0; font-size:10px; margin-bottom:4px; }.product-card-metrics strong { font-size:13px; }.product-bottleneck,.product-ready { display:flex; align-items:center; gap:5px; margin:0 0 13px; min-height:18px; font-size:11px; }.product-bottleneck { color:#ffbd50; }.product-ready { color:#33d797; }.product-bottleneck svg,.product-ready svg { width:14px; }
.type-pill { color:var(--primary-light); background:rgba(223,181,201,.1); border:1px solid rgba(223,181,201,.18); border-radius:5px; padding:4px 7px; font-size:10px; font-weight:700; }.strong { font-weight:700; }.inventory-name-cell { display:flex; align-items:center; gap:10px; }.inventory-thumb { width:32px; height:32px; flex:0 0 32px; object-fit:cover; border-radius:8px; border:1px solid rgba(223,181,201,.2); }.inventory-thumb-empty { display:grid; place-items:center; color:var(--primary-light); background:rgba(128,81,106,.15); }.inventory-thumb-empty svg { width:15px; }.inventory-table-card { overflow:hidden; }.inventory-table th { white-space:nowrap; }.inventory-table td { vertical-align:middle; }.inventory-status { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:11px; font-weight:700; }.inventory-status-dot, .inventory-status > span:empty { width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; display:inline-block; }.status-normal { color:#28d58e; }.status-critical { color:#ffb837; }.status-out { color:#ff6973; }
.inventory-form-card { max-width:900px; }.form-hint { display:block; margin-top:6px; color:#7d879b; font-size:11px; }
.inventory-detail-head { display:flex; justify-content:space-between; align-items:center; gap:20px; }.inventory-detail-title { display:flex; align-items:center; gap:16px; min-width:0; }.inventory-detail-title h2 { margin:4px 0; font-size:27px; }.inventory-detail-title p { max-width:650px; margin:0; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.inventory-detail-photo { width:68px; height:68px; flex:0 0 68px; object-fit:contain; display:grid; place-items:center; background:linear-gradient(180deg,#251f26,#1a161b); border:1px solid rgba(223,181,201,.2); border-radius:14px; color:var(--primary-light); }.inventory-detail-photo svg { width:27px; }.inventory-detail-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }.inventory-detail-stat { display:block; }.inventory-detail-stat > span:not(.inventory-status) { color:#8590a5; display:block; margin-top:7px; font-size:11px; }.inventory-detail-grid { align-items:start; }.inventory-detail-grid .detail-main,.inventory-detail-grid .detail-sidebar { min-width:0; }.inventory-detail-grid .card { margin-bottom:0; }.inventory-bom-card .card-header { align-items:flex-start; }.inventory-bom-card .card-header p { margin:5px 0 0; font-size:11px; }.bom-line { display:grid; grid-template-columns:minmax(150px,1.4fr) minmax(85px,.6fr) minmax(85px,.6fr) minmax(130px,1fr) 34px; gap:8px; align-items:center; }.bom-line + .bom-line { margin-top:8px; }.bom-actions { justify-content:space-between; margin-top:13px; }.bom-summary { display:flex; gap:20px; flex-wrap:wrap; margin-top:17px; padding-top:13px; border-top:1px solid var(--border-color); color:#a1a9ba; font-size:12px; }.inventory-summary strong { color:#f1f4fb; }.inventory-job-panel { position:relative; overflow:hidden; margin:18px 24px 20px; padding:0; background:linear-gradient(180deg,#151822 0%,#10121a 100%); border:1px solid rgba(223,181,201,.16); border-top:none; border-radius:14px; box-shadow:0 6px 24px rgba(0,0,0,.35); transition:all .25s ease; }.inventory-job-panel::before,.inventory-order-selector::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; background:linear-gradient(90deg,transparent 5%,var(--primary) 25%,var(--primary-light) 50%,var(--primary) 75%,transparent 95%); pointer-events:none; z-index:2; }.inventory-job-panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 22px; cursor:pointer; user-select:none; transition:background .15s ease; background:rgba(255,255,255,.015); }.inventory-job-panel-head:hover { background:rgba(223,181,201,.04); }.inventory-job-panel.is-expanded .inventory-job-panel-head { border-bottom:1px solid rgba(223,181,201,.12); }.inventory-head-left { display:flex; flex-direction:column; gap:4px; min-width:0; }.inventory-head-left .eyebrow { font-size:10px; font-weight:700; letter-spacing:.08em; color:var(--primary-light); display:inline-flex; align-items:center; gap:5px; text-transform:uppercase; }.inventory-head-title-row { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }.inventory-head-title { margin:0; font-size:16px; color:#ffffff; font-weight:700; letter-spacing:-.01em; }.inventory-head-pills { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }.inventory-head-pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:6px; font-size:11px; color:#cad0de; }.inventory-head-pill svg { width:12px; height:12px; color:var(--primary-light); }.inventory-head-shortage-dot { width:7px; height:7px; border-radius:50%; background:#ff6b75; box-shadow:0 0 6px rgba(255,107,117,.6); display:inline-block; }.inventory-head-right { display:flex; align-items:center; gap:12px; flex-shrink:0; }.inventory-head-right .badge-shortage { display:inline-flex; align-items:center; padding:3px 9px; font-size:11px; font-weight:700; color:#ff858d; background:rgba(255,107,117,.14); border:1px solid rgba(255,107,117,.32); border-radius:6px; white-space:nowrap; line-height:1.2; }.inventory-job-panel.is-collapsed .inventory-job-panel-body { display:none !important; }.inventory-toggle-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 13px; border-radius:8px; background:rgba(223,181,201,.08); border:1px solid rgba(223,181,201,.22); color:var(--primary-light); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s ease; }.inventory-toggle-btn:hover { background:rgba(223,181,201,.16); color:#ffffff; border-color:rgba(223,181,201,.4); }.inventory-toggle-btn .toggle-icon { width:14px; height:14px; transition:transform .25s ease; }.inventory-job-panel.is-expanded .toggle-icon { transform:rotate(180deg); }.inventory-job-panel-body { padding:20px 24px; animation:fadeInPanel .2s ease; }@keyframes fadeInPanel { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }.inventory-product-tabs { display:flex; align-items:center; gap:8px; margin:0 0 16px; flex-wrap:wrap; }.inventory-product-tab { display:inline-flex; align-items:center; gap:8px; padding:7px 14px; border-radius:8px; font-size:12px; font-weight:600; color:#9DA3B8; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08); cursor:pointer; transition:all .15s ease; text-decoration:none; }.inventory-product-tab svg { width:14px; height:14px; color:var(--primary-light); }.inventory-product-tab:hover { color:#ffffff; background:rgba(223,181,201,.08); border-color:rgba(223,181,201,.25); }.inventory-product-tab.is-active { color:#ffffff; background:rgba(128,81,106,.18); border:1px solid rgba(223,181,201,.35); box-shadow:0 2px 8px rgba(0,0,0,.25); }.inventory-product-tab .badge-shortage { background:rgba(255,107,107,.15); color:#ff858d; border:1px solid rgba(255,107,107,.3); font-size:11px; font-weight:600; padding:1px 7px; border-radius:6px; line-height:1.3; }.inventory-job-metrics { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:12px !important; margin:14px 0 16px !important; }.inventory-job-metrics > span { background:rgba(128,81,106,.08); border:1px solid rgba(223,181,201,.15); border-radius:9px; padding:10px 16px; min-width:0 !important; }.inventory-preview-summary { display:flex; flex-wrap:wrap; gap:12px; margin:14px 0; }.inventory-preview-summary > span { background:rgba(128,81,106,.08); border:1px solid rgba(223,181,201,.15); border-radius:9px; padding:9px 16px; min-width:125px; }.inventory-job-metrics small,.inventory-preview-summary small { display:block; color:var(--primary-light); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }.inventory-job-metrics strong,.inventory-preview-summary strong { color:#ffffff; font-size:15px; }.inventory-snapshot-note { margin:14px 0 0; font-size:11px; color:var(--text-muted); line-height:1.5; }.inventory-order-selector { position:relative; overflow:hidden; border:1px solid rgba(223,181,201,.14); border-top:none; background:linear-gradient(180deg,#151822 0%,#10121a 100%); border-radius:14px; padding:18px 20px; box-shadow:0 4px 20px rgba(0,0,0,.25); }.inventory-order-selector .section-header { align-items:flex-start; }.inventory-order-preview { margin-top:16px; padding:16px 18px; background:rgba(13,15,21,.8); border:1px solid rgba(223,181,201,.1); border-radius:12px; }.inventory-preview-table { width:100%; border-collapse:collapse; margin-top:8px; }.inventory-preview-table th { font-size:10.5px; font-weight:700; color:#dfb5c9; letter-spacing:.06em; text-transform:uppercase; padding:11px 14px; background:rgba(128,81,106,.08); border-bottom:1px solid rgba(223,181,201,.16); }.inventory-preview-table td { font-size:12.5px; padding:11px 14px; border-bottom:1px solid rgba(255,255,255,.04); color:#ECEEF4; vertical-align:middle; }.inventory-preview-table td strong { color:#ffffff; font-weight:600; }.inventory-preview-table tr:hover td { background:rgba(223,181,201,.06); }.badge-danger-subtle { display:inline-block; padding:3px 10px; font-size:11px; font-weight:700; color:#ff6b75; background:rgba(255,107,117,.12); border:1px solid rgba(255,107,117,.28); border-radius:6px; letter-spacing:.02em; }.th-sortable { cursor:pointer !important; user-select:none; transition:background-color .15s ease, color .15s ease; }.th-sortable:hover { color:#ffffff !important; background:rgba(223,181,201,.08) !important; }.th-sort-link { display:inline-flex; align-items:center; gap:6px; width:100%; }.th-sort-link.text-right { justify-content:flex-end; }.th-sort-icon { display:inline-flex; align-items:center; color:#6d7588; transition:color .15s ease; }.th-sort-icon svg { width:13px; height:13px; }.th-sortable:hover .th-sort-icon { color:var(--primary-light); }.th-sortable.is-sorted { color:var(--primary-light) !important; }.th-sortable.is-sorted .th-sort-icon { color:var(--primary-light); }.movement-list { display:flex; flex-direction:column; }.movement-row { display:flex; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--border-color); }.movement-row:last-child { border-bottom:0; }.movement-row strong,.movement-row small { display:block; }.movement-row strong { font-size:12px; }.movement-row small { margin-top:3px; color:#808b9f; font-size:10px; }.report-print { border:0; border-radius:6px; padding:9px 13px; color:#fff; background:var(--primary); font-weight:700; cursor:pointer; }.inventory-table-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:14px 0 10px; flex-wrap:wrap; }.inventory-filter-group { display:flex; align-items:center; gap:6px; }.inventory-filter-group .btn { border-radius:6px; font-size:11.5px; padding:4px 10px; }.inventory-filter-group .btn.is-active { background:rgba(223,181,201,.18); color:#ffffff; border-color:rgba(223,181,201,.35); font-weight:700; }.inventory-search-box { margin-left:auto; width:280px; max-width:100%; flex:0 0 auto; }.inventory-search-box input { height:32px; font-size:12px; }.inventory-material-link { color:var(--primary-light,#dfb5c9); text-decoration:none; transition:color .15s ease, text-decoration .15s ease; display:inline-flex; align-items:center; }.inventory-material-link strong { color:inherit !important; transition:color .15s ease; }.inventory-material-link:hover { color:#ffffff !important; text-decoration:underline !important; text-underline-offset:3px; }.inventory-material-link:hover strong { color:#ffffff !important; }
@media (max-width: 1050px) { .inventory-stats,.inventory-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }.product-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) { .inventory-intro,.inventory-detail-head { align-items:flex-start; flex-direction:column; }.inventory-intro h2,.inventory-detail-title h2 { font-size:23px; }.inventory-toolbar,.inventory-filter-form { align-items:stretch; flex-direction:column; }.inventory-tabs { overflow:auto; width:100%; }.inventory-tab { white-space:nowrap; }.inventory-filter-form { width:100%; justify-content:stretch; }.inventory-search { min-width:0; }.inventory-filter-form .form-select,.inventory-filter-form .btn { width:100%; }.product-card-grid,.inventory-stats,.inventory-detail-stats { grid-template-columns:1fr; }.bom-line { grid-template-columns:1fr 1fr; }.bom-line select { grid-column:1/-1; }.bom-line input:nth-of-type(3) { grid-column:1/-1; }.inventory-detail-title p { white-space:normal; }.inventory-detail-actions { width:100%; }.inventory-detail-actions .btn { flex:1; justify-content:center; } }
.bom-grouped-summary { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-top:14px; padding:11px 12px; color:#c9bcc4; background:rgba(35,29,36,.7); border:1px dashed rgba(223,181,201,.25); border-radius:9px; font-size:11px; }.bom-grouped-summary strong { width:100%; color:#f7f1f4; font-size:11px; }.bom-grouped-summary span { padding-right:12px; border-right:1px solid rgba(223,181,201,.15); }.bom-grouped-summary span:last-child { border-right:0; }
.inventory-detail-grid .detail-sidebar { display:flex; flex-direction:column; gap:16px; }
.inventory-detail-grid .detail-sidebar .card { width:100%; margin-bottom:0; }
.inventory-detail-grid .detail-sidebar .form-stack { min-width:0; }
.inventory-table { table-layout:fixed; min-width:820px; }
.inventory-table th:nth-child(1),.inventory-table td:nth-child(1) { width:26%; }
.inventory-table th:nth-child(2),.inventory-table td:nth-child(2) { width:11%; }
.inventory-table th:nth-child(3),.inventory-table td:nth-child(3) { width:11%; }
.inventory-table th:nth-child(4),.inventory-table td:nth-child(4) { width:11%; }
.inventory-table th:nth-child(5),.inventory-table td:nth-child(5) { width:12%; }
.inventory-table th:nth-child(6),.inventory-table td:nth-child(6) { width:12%; }
.inventory-table th:nth-child(7),.inventory-table td:nth-child(7) { width:15%; }
.inventory-table th:nth-child(8),.inventory-table td:nth-child(8) { width:2%; padding-left:6px; padding-right:6px; }
.inventory-table thead th:nth-child(3),.inventory-table thead th:nth-child(4),.inventory-table thead th:nth-child(5),.inventory-table thead th:nth-child(6) { text-align:right; }
.inventory-table td:first-child { overflow:hidden; text-overflow:ellipsis; }
.inventory-table .inventory-name-cell .link { display:inline-block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer !important; color:var(--primary-light); text-decoration:none; transition:color var(--t-fast), text-decoration var(--t-fast); }
.inventory-table .inventory-name-cell .link:hover,.inventory-table tbody tr:hover .inventory-name-cell .link:hover { color:#ffffff !important; text-decoration:underline !important; text-decoration-color:var(--primary-light) !important; text-underline-offset:3px !important; text-decoration-thickness:1.5px !important; }
.inventory-table .inventory-name-cell:hover .inventory-thumb { border-color:rgba(223,181,201,.45); background:rgba(128,81,106,.25); }
.inventory-table tbody tr:hover td { background:rgba(223,181,201,.04); }
.inventory-toolbar { align-items:stretch; flex-direction:column; gap:14px; padding:14px 16px 16px; }
.inventory-toolbar-top { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.inventory-filter-caption { display:inline-flex; align-items:center; gap:7px; color:#7f8aa1; font-size:11px; font-weight:700; letter-spacing:.04em; }
.inventory-filter-caption svg { width:15px; height:15px; color:var(--primary-light); }
.inventory-filter-form { display:grid; grid-template-columns:minmax(180px,1.55fr) repeat(5,minmax(100px,1fr)) minmax(115px,.95fr) minmax(115px,.95fr) auto; align-items:end; justify-content:stretch; width:100%; gap:9px; padding-top:14px; border-top:1px solid rgba(255,255,255,.06); }
.inventory-filter-form .inventory-search,.inventory-filter-form .form-select,.inventory-filter-form .form-input-sm { width:100%; min-width:0; }
.inventory-date-field { display:flex; min-width:0; flex-direction:column; gap:5px; }
.inventory-date-field span { color:#7f8aa1; font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.inventory-filter-form > .btn { width:100%; white-space:nowrap; }
@media (max-width: 1100px) { .inventory-filter-form { grid-template-columns:repeat(3,minmax(0,1fr)); }.inventory-filter-form .inventory-search { grid-column:span 2; } }
@media (max-width: 700px) { .inventory-toolbar-top { align-items:flex-start; flex-direction:column; }.inventory-filter-caption { display:none; }.inventory-filter-form { grid-template-columns:1fr; }.inventory-filter-form .inventory-search { grid-column:auto; }.inventory-date-field,.inventory-filter-form > .btn { width:100%; } }
.inventory-detail-grid .detail-main { display:flex; flex-direction:column; gap:16px; }

/* Pen Pilates Brand Enhancements & UI Utilities */
.stock-negative { color: #ff6b73 !important; font-weight: 700; }
.stock-warning { color: #ffba42 !important; font-weight: 700; }

/* Export Dropdown */
.export-dropdown { position: relative; display: inline-block; }
.export-dropdown-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.export-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 320px;
    background: #151822;
    border: 1px solid rgba(223, 181, 201, 0.22);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    z-index: 1000;
    padding: 8px 0;
}
.export-dropdown.is-open .export-dropdown-menu { display: block; }
.export-menu-section { padding: 8px 14px 4px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8d96aa; }
.export-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    transition: background .15s;
}
.export-menu-row:hover { background: rgba(255, 255, 255, 0.03); }
.export-menu-row-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #eceef4; font-weight: 500; }
.export-menu-row-label svg { width: 14px; height: 14px; color: var(--primary-light); }
.export-menu-buttons { display: flex; gap: 5px; }
.export-btn-mini {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    text-decoration: none;
    background: rgba(223, 181, 201, 0.08);
    color: var(--primary-light);
    border: 1px solid rgba(223, 181, 201, 0.18);
    transition: all .15s ease;
}
.export-btn-mini:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Advanced Filter Drawer */
.inventory-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.inventory-filter-primary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}
.inventory-filter-primary-row .inventory-search { flex: 1; min-width: 220px; }
.inventory-filter-advanced-drawer {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    width: 100%;
}
.inventory-filter-advanced-drawer.is-open { display: grid; }
.btn-toggle-advanced {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s ease;
}
.btn-toggle-advanced:hover, .btn-toggle-advanced.is-active {
    background: var(--primary-subtle);
    border-color: rgba(223, 181, 201, 0.3);
    color: var(--primary-light);
}

/* Image Preview Modal (Lightbox) */
.modal.image-preview-modal {
    max-width: 840px;
    width: 92%;
    background: #141722;
    border: 1px solid rgba(223, 181, 201, 0.28);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
    padding: 20px;
    overflow: hidden;
}
.image-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.image-preview-title {
    font-size: 16px;
    font-weight: 700;
    color: #eceef4;
    margin: 0;
}
.image-preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(38, 30, 38, 0.95) 0%, rgba(18, 15, 19, 0.98) 100%);
    border: 1px solid rgba(223, 181, 201, 0.15);
    border-radius: 12px;
    padding: 16px;
    max-height: 72vh;
    overflow: hidden;
}
.image-preview-img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
[data-preview-image] {
    cursor: zoom-in !important;
    transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}
[data-preview-image]:hover {
    opacity: 0.9;
    filter: brightness(1.08);
}

/* ── Sortable Table Headers ── */
.th-sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--t-fast), color var(--t-fast);
}
.th-sortable:hover {
    background: rgba(223, 181, 201, 0.08);
    color: var(--primary-light);
}
.th-sortable.is-sorted {
    color: var(--primary-light);
}
.th-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    width: 100%;
}
.th-sort-link.text-right {
    justify-content: flex-end;
}
.th-sort-icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.45;
    transition: opacity var(--t-fast), transform var(--t-fast);
}
.th-sort-icon svg {
    width: 14px;
    height: 14px;
}
.th-sortable:hover .th-sort-icon,
.th-sortable.is-sorted .th-sort-icon {
    opacity: 1;
    color: var(--primary-light);
}

/* ══════════════════════════════════════════════════════════
   DEADLINE BADGES & TRACKER (LASER-ALIGNED "ZIPKIN GİBİ")
   ══════════════════════════════════════════════════════════ */
/* Universal base reset for all deadline badges */
.badge[class*="badge-deadline-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    line-height: 1;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.77rem;
    font-weight: 650;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
    gap: 6px;
    vertical-align: middle;
}

/* Eliminate phantom ::before dot from base .badge::before */
.badge[class*="badge-deadline-"]::before {
    display: none !important;
    content: none !important;
}

/* Optical icon centering */
.badge[class*="badge-deadline-"] svg {
    width: 13px;
    height: 13px;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

/* Specific theme variations */
.badge-deadline-overdue {
    background: rgba(255, 107, 107, 0.18);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.45);
    font-weight: 700;
}
.badge-deadline-today {
    background: rgba(255, 107, 107, 0.22);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.5);
    font-weight: 700;
    animation: pulseGlow 2s infinite ease-in-out;
}
.badge-deadline-critical {
    background: rgba(255, 107, 107, 0.18);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.45);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.badge-deadline-soon {
    background: rgba(255, 184, 46, 0.16);
    color: #FFB82E;
    border: 1px solid rgba(255, 184, 46, 0.38);
    font-weight: 650;
}
.badge-deadline-approaching {
    background: rgba(91, 158, 255, 0.14);
    color: #5B9EFF;
    border: 1px solid rgba(91, 158, 255, 0.3);
    font-weight: 600;
}
.badge-deadline-normal {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 550;
}
.badge-deadline-done {
    background: rgba(255, 255, 255, 0.04);
    color: #8fa0b5;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 600;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.badge-deadline-done svg {
    color: #64748b;
}

/* Card Header Badges (e.g. Dashboard Termin Tracker Header) */
.card-deadline-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.card-deadline-badges .badge {
    height: 28px;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
}
.card-deadline-badges .badge::before {
    display: none !important;
    content: none !important;
}
.card-deadline-badges .badge svg {
    width: 14px;
    height: 14px;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

/* Upper Tracker Table: Termin / Durum Column & Pill */
.col-tracker-deadline,
th.col-tracker-deadline,
td.col-tracker-deadline {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
    text-align: center !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}
.badge-tracker-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1;
    box-sizing: border-box;
    gap: 6px;
    white-space: nowrap;
    margin: 0 auto;
}
.badge-tracker-pill::before {
    display: none !important;
    content: none !important;
}
.badge-tracker-pill svg {
    width: 13px;
    height: 13px;
    display: block;
    margin: 0;
    flex-shrink: 0;
}
.badge-tracker-pill .pill-dot {
    opacity: 0.5;
    font-weight: 400;
    margin: 0 1px;
}

/* Standard Table: Termin Column — Fixed width for laser alignment ("Zıpkın Gibi") */
.col-deadline,
th.col-deadline,
td.col-deadline {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
    text-align: center !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.col-deadline .badge[class*="badge-deadline-"] {
    width: 128px;
    min-width: 128px;
    max-width: 128px;
    height: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 6px;
    padding: 0 8px;
    gap: 6px;
    margin: 0 auto;
    font-size: 0.76rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.01em;
}
.col-deadline .col-deadline-empty {
    display: inline-block;
    width: 128px;
    text-align: center;
    color: var(--text-muted);
}

/* Standard Table: Status Column — Fixed width for laser alignment */
.col-status,
th.col-status,
td.col-status {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    text-align: center !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}
.col-status .badge {
    width: 114px;
    min-width: 114px;
    max-width: 114px;
    height: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 auto;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    gap: 6px;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 46, 0); }
    50% { box-shadow: 0 0 8px 1px rgba(255, 184, 46, 0.3); }
}

/* ══════════════════════════════════════════════════════════
   TOPBAR QUICK SEARCH BUTTON
   ══════════════════════════════════════════════════════════ */
.topbar-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.topbar-search-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.topbar-search-btn svg {
    width: 15px;
    height: 15px;
    color: var(--primary-light);
}
.search-kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.72rem;
    font-family: inherit;
    color: var(--text-secondary);
}
.mobile-search-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
}
.mobile-search-btn svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}
@media (max-width: 768px) {
    .topbar-search-btn {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
   COMMAND PALETTE MODAL (<dialog>)
   ══════════════════════════════════════════════════════════ */
.command-palette-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    z-index: 99998;
    padding: 0;
    border: 1px solid var(--border-focus);
    background: transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popup), 0 0 50px rgba(128, 81, 106, 0.35);
    max-width: 580px;
    width: 92vw;
    color: var(--text-primary);
    overflow: hidden;
}
.command-palette-dialog:not([open]) {
    display: none;
}
.command-palette-dialog::backdrop {
    background: rgba(11, 13, 18, 0.78);
    backdrop-filter: blur(8px);
}
.command-palette-container {
    background: #131620;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.command-palette-search-box {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    background: #171A26;
}
.palette-search-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
    flex-shrink: 0;
}
.palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.02rem;
    font-family: inherit;
}
.palette-input::placeholder {
    color: var(--text-muted);
}
.palette-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}
.command-palette-body {
    padding: 10px;
    overflow-y: auto;
    max-height: 380px;
}
.palette-group-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 10px 4px 10px;
    font-weight: 600;
}
.palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--t-fast);
}
.palette-item:hover,
.palette-item.is-active {
    background: rgba(223, 181, 201, 0.12);
    outline: none;
}
.palette-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
}
.palette-item:hover .palette-item-icon,
.palette-item.is-active .palette-item-icon {
    background: var(--primary);
    color: #fff;
}
.palette-item-content {
    flex: 1;
    min-width: 0;
}
.palette-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.palette-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.palette-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-weight: 500;
}
.palette-badge-customer { background: rgba(91, 158, 255, 0.15); color: #5B9EFF; }
.palette-badge-job { background: rgba(223, 181, 201, 0.18); color: var(--primary-light); }
.palette-badge-inventory { background: rgba(34, 217, 142, 0.15); color: #22D98E; }
.palette-badge-proposal { background: rgba(255, 184, 46, 0.15); color: #FFB82E; }
.palette-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.palette-arrow {
    opacity: 0;
    transition: opacity var(--t-fast), transform var(--t-fast);
    color: var(--primary-light);
}
.palette-item:hover .palette-arrow,
.palette-item.is-active .palette-arrow {
    opacity: 1;
    transform: translateX(3px);
}
.palette-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.palette-empty svg {
    margin-bottom: 8px;
    opacity: 0.5;
}
.command-palette-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: #10121A;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.palette-tip {
    display: flex;
    gap: 12px;
}
.palette-tip kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════
   ENHANCED TOAST NOTIFICATION ENGINE (Sağ Alt - Premium UI)
   ══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    top: auto !important;
    left: auto !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 10px !important;
    pointer-events: none !important;
    max-width: 380px !important;
    width: calc(100vw - 32px) !important;
}
.toast-item {
    pointer-events: auto;
    background: rgba(18, 21, 31, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.35);
    padding: 13px 14px 14px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transform: translateX(115%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
.toast-item.is-visible {
    transform: translateX(0);
    opacity: 1;
}
.toast-item.is-hiding {
    transform: translateX(115%);
    opacity: 0;
    pointer-events: none;
}
.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-icon svg {
    width: 17px;
    height: 17px;
}
.toast-content {
    flex: 1;
    min-width: 0;
    margin-bottom: 3px;
}
.toast-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: #f8fafc;
    margin-bottom: 2px;
    line-height: 1.3;
}
.toast-message {
    font-size: 0.81rem;
    color: #94a3b8;
    line-height: 1.45;
    word-break: break-word;
}
.toast-close {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 3px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    margin-top: -2px;
    margin-right: -2px;
}
.toast-close:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
}
.toast-close svg {
    width: 14px;
    height: 14px;
}

/* Discrete Inset Floating Progress Track & Bar */
.toast-progress-track {
    position: absolute;
    bottom: 5px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    pointer-events: none;
}
.toast-progress-bar {
    height: 100%;
    width: 100%;
    border-radius: 99px;
    transform-origin: left;
    transition: transform linear;
}

/* Toast Variants with Soft Badges (NO thick border collisions!) */
.toast-success {
    border-color: rgba(34, 197, 94, 0.22);
}
.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.22);
}
.toast-success .toast-progress-bar {
    background: #22c55e;
}

.toast-danger,
.toast-error {
    border-color: rgba(239, 68, 68, 0.22);
}
.toast-danger .toast-icon,
.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.22);
}
.toast-danger .toast-progress-bar,
.toast-error .toast-progress-bar {
    background: #ef4444;
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.22);
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.22);
}
.toast-warning .toast-progress-bar {
    background: #f59e0b;
}

.toast-info {
    border-color: rgba(223, 181, 201, 0.22);
}
.toast-info .toast-icon {
    background: rgba(223, 181, 201, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(223, 181, 201, 0.22);
}
.toast-info .toast-progress-bar {
    background: var(--primary-light);
}

/* Keep stock movement text and amounts inside the detail sidebar card. */
.inventory-detail-grid .movement-list {
    min-width: 0;
    padding: 0 16px 10px;
}
.inventory-detail-grid .movement-row {
    align-items: flex-start;
}
.inventory-detail-grid .movement-row > div {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.inventory-detail-grid .movement-row > .mono {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
}

/* Proposal lines use the same product/recipe grid as job lines. */
.proposal-product-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.proposal-product-actions #quickAddProductSelect { width:auto; min-width:170px; max-width:240px; }
.proposal-recipe-panel { margin:20px 0; overflow:hidden; background:linear-gradient(180deg,#151822,#10121a); border:1px solid rgba(223,181,201,.18); border-radius:14px; }
.proposal-recipe-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 20px; border-bottom:1px solid rgba(223,181,201,.12); }
.proposal-recipe-heading .eyebrow { display:inline-flex; align-items:center; gap:6px; color:var(--primary-light); font-size:10px; font-weight:700; letter-spacing:.08em; }
.proposal-recipe-heading .eyebrow svg { width:13px; height:13px; }
.proposal-recipe-heading h3 { margin:5px 0 0; font-size:16px; }
.proposal-recipe-heading > .text-muted { font-size:11px; }
.proposal-recipe-list { padding:2px 20px; }
.proposal-recipe-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; }
.proposal-recipe-row + .proposal-recipe-row { border-top:1px solid var(--border-color); }
.proposal-recipe-row strong,.proposal-recipe-row small { display:block; }
.proposal-recipe-row small { margin-top:3px; color:var(--text-muted); font-size:11px; }
.proposal-recipe-row .btn { flex-shrink:0; }
@media (max-width:700px) {
    .proposal-product-actions { width:100%; }
    .proposal-product-actions #quickAddProductSelect { flex:1 1 180px; max-width:none; }
    .proposal-recipe-heading { align-items:flex-start; flex-direction:column; }
    .proposal-recipe-row { align-items:flex-start; flex-direction:column; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE TABLES + former inline styles (CSP blocks style="")
   ══════════════════════════════════════════════════════════ */
/* On 1280–1440px laptops, low-priority columns step aside so the money
   columns (Toplam / Ödenen / Kalan) stay on screen without scrolling. */
@media (max-width: 1440px) {
    .data-table .col-optional { display: none; }
}
/* Long customer names and job titles wrap instead of widening the table. */
.data-table tbody td.cell-wrap { white-space: normal; min-width: 120px; }

.col-w-tracker { width: 230px; }
.col-w-action { width: 100px; text-align: right !important; }
.col-w-money { min-width: 100px; }
.col-w-date { width: 110px; }
.col-w-thumb { width: 36px; }
.select-w-160 { max-width: 160px; }
.select-w-170 { max-width: 170px; }
.select-w-180 { max-width: 180px; }
.gap-8 { gap: 8px; }
.report-toolbar-end { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 20px; }
.badge-xs { font-size: 10px; padding: 1px 6px; }
.preview-product-caption { margin: 8px 0 12px; font-size: 12px; color: #A1A9BA; }
.preview-product-caption .is-bright { color: #ffffff; }
.inventory-product-tabs.is-compact { margin-bottom: 12px; }

/* Dashboard payment/expense tables: amounts need the widest column. */
.dashboard-secondary-grid .col-entity { width: 28%; }
.dashboard-secondary-grid .col-detail { width: 24%; }
.dashboard-secondary-grid .col-amount { width: 29%; }
.dashboard-secondary-grid .col-date   { width: 19%; }
.dashboard-secondary-grid .data-table th,
.dashboard-secondary-grid .data-table td { padding-left: 12px; padding-right: 12px; }
/* These half-width cards truncate text with an ellipsis instead of scrolling. */
.dashboard-secondary-grid .table-responsive .data-table { min-width: 0; }

/* Phones: list rows become labelled cards, so every value is visible. */
@media (max-width: 768px) {
    .table-responsive .data-table.table-stack { min-width: 0; }
    .data-table.table-stack thead { display: none; }
    .data-table.table-stack,
    .data-table.table-stack tbody,
    .data-table.table-stack tr { display: block; width: 100%; }
    .data-table.table-stack tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .data-table.table-stack tbody td,
    .data-table.table-stack tbody td.col-status,
    .data-table.table-stack tbody td.col-deadline {
        display: flex; justify-content: space-between; align-items: center; gap: 12px;
        width: 100%; min-width: 0; max-width: none;
        padding: 5px 0 !important; border: 0; white-space: normal; text-align: right !important;
    }
    .data-table.table-stack tbody td::before {
        content: attr(data-label); flex: 0 0 auto; text-align: left;
        color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    }
    .data-table.table-stack tbody td.col-optional { display: none; }
    .data-table.table-stack .col-deadline .badge[class*="badge-deadline-"],
    .data-table.table-stack .col-deadline .col-deadline-empty,
    .data-table.table-stack .col-status .badge { margin: 0; }
}

/* ══════════════════════════════════════════════════════════
   EXPENSES — type switch + line items (create/edit)
   ══════════════════════════════════════════════════════════ */
.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.segmented-option { position: relative; cursor: pointer; }
.segmented-option input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-option span {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    transition: background var(--t-fast), color var(--t-fast);
}
.segmented-option span svg { width: 15px; height: 15px; }
.segmented-option:hover span { color: var(--text-primary); }
.segmented-option input:checked + span { background: var(--primary); color: #fff; }
.segmented-option input:focus-visible + span { outline: 2px solid var(--primary-light); outline-offset: 2px; }

.expense-items .items-header,
.expense-items .item-row {
    grid-template-columns: minmax(0, 1fr) 190px 36px;
}

.expense-qty { display: flex; align-items: center; gap: 6px; min-width: 0; }
.expense-qty .form-input { min-width: 0; flex: 1 1 auto; }
.expense-unit {
    flex: 0 0 auto; max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 11px; color: var(--text-muted);
}

@media (max-width: 768px) {
    .expense-items .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .expense-items .item-row .item-product-select { grid-column: 1 / -1; }
    .segmented { display: flex; }
    .segmented-option { flex: 1 1 0; }
    .segmented-option span { justify-content: center; width: 100%; }
    .data-table.table-stack tfoot,
    .data-table.table-stack tfoot tr { display: flex; justify-content: space-between; width: 100%; }
    .data-table.table-stack tfoot td { display: block; }
}


/* ══════════════════════════════════════════════════════════
   PenSelect — searchable dropdown (js/pen-select.js)
   ══════════════════════════════════════════════════════════ */
.pen-select-native {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important;
    opacity: 0 !important; pointer-events: none !important;
    clip-path: inset(50%);
}
.pen-select {
    display: flex; align-items: center; width: 100%; min-width: 0;
    text-align: left; cursor: pointer; font-family: inherit;
}
.pen-select .pen-select-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pen-select.is-placeholder .pen-select-value { color: var(--text-muted); font-weight: 400; }
.pen-select.is-open,
.pen-select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223, 181, 201, 0.1); }
.pen-select.is-invalid { border-color: var(--danger); }
.pen-select:disabled { background-color: var(--bg-hover); color: var(--text-muted); opacity: 0.8; cursor: not-allowed; }

.pen-select-panel {
    position: fixed; z-index: 1200;
    display: flex; flex-direction: column;
    background: var(--bg-card);
    border: 1px solid rgba(223, 181, 201, 0.18);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-popup);
    overflow: hidden;
    animation: penSelectIn 0.12s var(--ease) both;
}
.pen-select-panel.is-hidden { display: none; }
@keyframes penSelectIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pen-select-panel.is-up { animation-name: penSelectInUp; }
@keyframes penSelectInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.pen-select-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.pen-select-search input {
    flex: 1 1 auto; min-width: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 7px 10px;
    font: inherit; font-size: 13px;
}
.pen-select-search input:focus { outline: none; border-color: var(--primary); }
.pen-select-list {
    list-style: none; margin: 0; padding: 4px;
    overflow-y: auto; overscroll-behavior: contain;
}
.pen-select-option {
    padding: 7px 10px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pen-select-option.is-active { background: rgba(128, 81, 106, 0.28); color: var(--text-primary); }
.pen-select-option.is-selected { color: var(--primary-light); font-weight: 600; }
.pen-select-option.is-selected::before { content: '✓ '; }
.pen-select-option.is-empty { color: var(--text-muted); font-style: italic; }
.pen-select-option mark { background: transparent; color: var(--primary-light); font-weight: 700; }
.pen-select-footer {
    padding: 6px 12px; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-muted);
}
.pen-select-footer.is-hidden { display: none; }

/* Proposal and job discounts */
.items-table:not(.has-discount) .item-discount,
.items-table:not(.has-discount) .item-col-discount { display: none; }
.price-old { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); text-decoration: line-through; }
.price-badge { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--success); }
.items-table.has-products.has-discount .items-header,
.items-table.has-products.has-discount .item-row {
    grid-template-columns: 1.1fr 1.4fr 70px 110px 175px 100px 36px;
}
.item-discount { display: flex; gap: 4px; min-width: 0; }
.item-discount .form-input { min-width: 0; }
.item-discount .item-discount-unit { flex: 0 0 56px; padding-left: 8px; padding-right: 18px; background-position: right 4px center; }
.item-row .item-discount .item-discount-unit { flex-basis: 88px; }
.item-discount input.form-input { flex: 1 1 auto; }
.item-discount input.is-invalid-discount { border-color: var(--danger); }
.general-discount {
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px;
    padding: 14px 12px 0; margin-top: 8px;
}
.general-discount .form-label { margin: 0; }
.general-discount .item-discount { width: 210px; }
.general-discount-hint { font-size: 11px; color: var(--text-muted); }

@media (max-width: 768px) {
    .items-table.has-products.has-discount .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .item-row .item-discount { grid-column: 1 / -1; }
    .general-discount { justify-content: flex-start; }
    .general-discount .item-discount { width: 100%; }
}
@media (max-width: 480px) {
    .items-table.has-products.has-discount .item-row { grid-template-columns: minmax(0, 1fr); }
}

/* Item section header: checkboxes, product picker and button stay on one line */
.section-header .checkbox-label,
.section-header #addItemBtn { white-space: nowrap; flex: 0 0 auto; }
#quickAddProductSelect + .pen-select { width: 220px; flex: 0 1 220px; }
.section-header:has(> .proposal-product-actions) { gap: 16px; }

@media (min-width: 769px) {
    .proposal-product-actions { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; }
}

@media (max-width: 768px) {
    .section-header:has(> .proposal-product-actions) { flex-wrap: wrap; }
    #quickAddProductSelect + .pen-select { width: auto; flex: 1 1 180px; }
}
