/* ============================================================
   PERDİVA — Über Profesyonel Tema
   Bakır + Lacivert + Glassmorphism
   ============================================================ */

:root {
    /* Brand */
    --brand-copper-1: #E5A775;
    --brand-copper-2: #C58864;
    --brand-copper-3: #9C6A4D;
    --brand-copper-deep: #6B4530;
    --brand-navy-1: #050b18;
    --brand-navy-2: #0a1628;
    --brand-navy-3: #142441;
    --brand-navy-4: #1d3358;

    /* Surface */
    --surface-1: rgba(20, 36, 65, 0.55);
    --surface-2: rgba(28, 48, 84, 0.65);
    --surface-3: rgba(38, 60, 100, 0.75);
    --surface-glass: rgba(15, 28, 50, 0.55);
    --surface-hover: rgba(35, 58, 100, 0.8);

    /* Text */
    --text-primary: #EDF2FB;
    --text-secondary: #B8C6E0;
    --text-muted: #7E92B5;
    --text-dim: #4F6486;

    /* Lines */
    --line-soft: rgba(197, 136, 100, 0.12);
    --line-medium: rgba(197, 136, 100, 0.22);
    --line-strong: rgba(197, 136, 100, 0.4);

    /* States */
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;

    /* Shadows */
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.5);
    --shadow-copper-glow: 0 0 30px rgba(197, 136, 100, 0.3);
    --shadow-copper-strong: 0 0 50px rgba(229, 167, 117, 0.5);

    /* Gradients */
    --grad-copper: linear-gradient(135deg, #E5A775 0%, #C58864 50%, #9C6A4D 100%);
    --grad-copper-soft: linear-gradient(135deg, rgba(229, 167, 117, 0.15), rgba(197, 136, 100, 0.05));
    --grad-bg: radial-gradient(ellipse at top left, #142441 0%, #0a1628 50%, #050b18 100%);
    --grad-card: linear-gradient(145deg, rgba(28, 48, 84, 0.7) 0%, rgba(15, 28, 50, 0.85) 100%);

    /* Misc */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ Reset ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--grad-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
}

/* Ambient background orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}
body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(197, 136, 100, 0.4), transparent 70%);
    top: -150px;
    right: -100px;
    animation: float-1 18s ease-in-out infinite;
}
body::after {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(29, 51, 88, 0.6), transparent 70%);
    bottom: -200px;
    left: -150px;
    animation: float-2 22s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 80px) scale(1.1); }
}
@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, -60px) scale(1.15); }
}

/* ============ Layout ============ */
.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============ Sidebar ============ */
.sidebar {
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.85) 0%, rgba(5, 11, 24, 0.95) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--brand-copper-2) 30%,
        var(--brand-copper-2) 70%,
        transparent 100%);
    opacity: 0.3;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px 28px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 20px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--grad-copper);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-navy-1);
    font-weight: 800;
    font-size: 22px;
    font-family: 'Playfair Display', 'Georgia', serif;
    box-shadow: var(--shadow-copper-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: brand-pulse 4s ease-in-out infinite;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.brand-mark::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 5s ease-in-out infinite;
}

@keyframes brand-pulse {
    0%, 100% { box-shadow: var(--shadow-copper-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: var(--shadow-copper-strong), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}

@keyframes shimmer {
    0%, 90%, 100% { left: -100%; }
    50% { left: 100%; }
}

.brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-name {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.18em;
    background: var(--grad-copper);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.brand-sub {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-top: 6px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--surface-1);
    color: var(--text-primary);
    border-color: var(--line-soft);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--grad-copper-soft);
    color: var(--brand-copper-1);
    border-color: var(--line-medium);
    box-shadow: 0 0 0 1px var(--line-soft) inset, 0 4px 16px rgba(197, 136, 100, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--grad-copper);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px rgba(229, 167, 117, 0.6);
}

.sidebar-footer {
    padding: 16px 24px 0;
    border-top: 1px solid var(--line-soft);
    margin-top: 16px;
}

.sidebar-footer-text {
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* User pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
}
.user-pill-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--grad-copper);
    color: var(--brand-navy-1);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.user-pill-info { flex: 1; min-width: 0; }
.user-pill-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-pill-role {
    font-size: 10px;
    color: var(--brand-copper-1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.user-pill-logout {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--line-soft);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.user-pill-logout:hover {
    background: rgba(248, 113, 113, 0.12);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.4);
}

/* ============ Main ============ */
.main {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 40px 80px;
    position: relative;
}

.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--line-medium); border-radius: 4px; }
.main::-webkit-scrollbar-thumb:hover { background: var(--brand-copper-3); }

/* ============ View ============ */
.view {
    display: none;
    animation: view-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.view.active {
    display: block;
}

@keyframes view-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-soft);
}

.view-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #EDF2FB 0%, #B8C6E0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
    margin-bottom: 8px;
}

.view-sub {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.view-actions {
    display: flex;
    gap: 10px;
}

/* ============ Card ============ */
.card {
    background: var(--grad-card);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: visible;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-copper-2), transparent);
    opacity: 0.5;
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-soft);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--grad-copper-soft);
    border: 1px solid var(--line-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-copper-1);
}
.card-icon svg { width: 16px; height: 16px; }

/* ============ Form ============ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.field.full { grid-column: 1 / -1; }

.field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field .required {
    color: var(--brand-copper-1);
    font-size: 13px;
}

.field input,
.field textarea,
.field select {
    background: rgba(5, 11, 24, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-dim);
}

.field input:hover,
.field textarea:hover,
.field select:hover {
    border-color: var(--line-medium);
    background: rgba(10, 22, 40, 0.6);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--brand-copper-2);
    background: rgba(10, 22, 40, 0.7);
    box-shadow: 0 0 0 3px rgba(197, 136, 100, 0.15);
}

.field.invalid input,
.field.invalid textarea {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.field-error {
    color: var(--error);
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
    display: none;
}

.field.invalid .field-error {
    display: block;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.02em;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--grad-copper);
    color: var(--brand-navy-1);
    box-shadow: 0 4px 14px rgba(197, 136, 100, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 700;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(229, 167, 117, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.08);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: var(--surface-1);
    color: var(--text-secondary);
    border-color: var(--line-soft);
}
.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--line-medium);
}

.btn-outline {
    background: transparent;
    color: var(--brand-copper-1);
    border-color: var(--line-medium);
}
.btn-outline:hover {
    background: var(--grad-copper-soft);
    border-color: var(--brand-copper-2);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.5);
}

.btn-icon {
    padding: 9px;
    background: var(--surface-1);
    border-color: var(--line-soft);
    color: var(--text-secondary);
}
.btn-icon:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--line-medium);
}
.btn-icon.danger:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.4);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}

/* ============ Customer Picker ============ */
.customer-picker {
    display: grid;
    grid-template-columns: 2fr auto;
    gap: 16px;
    align-items: end;
}

.customer-display {
    background: rgba(5, 11, 24, 0.4);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.customer-display.empty {
    color: var(--text-dim);
    font-style: italic;
    align-items: center;
    justify-content: center;
}

.customer-display .cd-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-copper-1);
    margin-bottom: 4px;
}

.customer-display .cd-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.customer-display .cd-meta span {
    display: inline-block;
    margin-right: 14px;
}

.customer-picker-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============ Customer List Table ============ */
.cust-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.cust-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--line-medium);
    background: rgba(5, 11, 24, 0.4);
}

.cust-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-primary);
    font-size: 13px;
    vertical-align: middle;
}

.cust-table tbody tr {
    transition: all var(--transition-fast);
}
.cust-table tbody tr:hover {
    background: var(--surface-1);
}

.cust-table .cell-company {
    font-weight: 600;
    color: var(--brand-copper-1);
}

.cust-table .cell-phone {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.cust-table .cell-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

.cust-table .cell-actions .btn-icon {
    margin-left: 6px;
}

.cust-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.cust-empty svg {
    width: 56px;
    height: 56px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.cust-empty-title {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
}
.cust-empty-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============ Order Rows ============ */
.order-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-row {
    display: grid;
    grid-template-columns: 44px 1.4fr 1fr 0.7fr 44px;
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    animation: row-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes row-enter {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.order-row:hover {
    border-color: var(--line-medium);
    background: var(--surface-2);
}

.order-row.row-complete {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.04);
}

.row-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--grad-copper-soft);
    border: 1px solid var(--line-medium);
    color: var(--brand-copper-1);
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    align-self: center;
}

.row-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.row-field label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.row-field input {
    background: rgba(5, 11, 24, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.row-field input:focus {
    border-color: var(--brand-copper-2);
    background: rgba(10, 22, 40, 0.7);
    box-shadow: 0 0 0 3px rgba(197, 136, 100, 0.15);
}

.row-field input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.row-remove {
    background: transparent;
    border: 1px solid var(--line-soft);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.row-remove:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.4);
}
.row-remove svg { width: 16px; height: 16px; }

.row-converted {
    grid-column: 2 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 20px;
}

.converted-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(5, 11, 24, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

.converted-tag.tag-category {
    background: rgba(197, 136, 100, 0.1);
    border-color: var(--line-medium);
    color: var(--brand-copper-1);
}

.converted-tag.tag-supplier {
    background: rgba(29, 51, 88, 0.5);
    border-color: rgba(99, 130, 180, 0.3);
    color: #B8C6E0;
}

.converted-placeholder {
    font-size: 11px;
    color: var(--text-dim);
    font-style: italic;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--text-dim);
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 18px;
    color: var(--text-secondary);
}

.hidden { display: none !important; }

/* ============ Autocomplete Dropdown ============ */
.ac-dropdown {
    position: fixed;
    background: linear-gradient(160deg, rgba(20, 36, 65, 0.98) 0%, rgba(10, 22, 40, 0.99) 100%);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    overflow-y: auto;
    z-index: 9999;
    box-shadow: var(--shadow-deep), 0 0 0 1px rgba(0, 0, 0, 0.4);
    display: none;
}

.ac-dropdown::-webkit-scrollbar { width: 6px; }
.ac-dropdown::-webkit-scrollbar-track { background: transparent; }
.ac-dropdown::-webkit-scrollbar-thumb { background: var(--line-medium); border-radius: 3px; }

.ac-dropdown.open {
    display: block;
    animation: dd-enter 0.2s ease-out;
}

@keyframes dd-enter {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ac-option {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--line-soft);
    transition: background var(--transition-fast);
}

.ac-option:last-child { border-bottom: none; }

.ac-option:hover,
.ac-option.highlighted {
    background: var(--grad-copper-soft);
}

.ac-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ Summary Bar ============ */
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 24px;
    background: var(--grad-card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    margin-top: 20px;
}

.summary-info {
    display: flex;
    gap: 14px;
    align-items: center;
}

.summary-count, .summary-meter {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.summary-count strong, .summary-meter strong {
    color: var(--brand-copper-1);
    font-weight: 700;
    font-size: 16px;
    margin-right: 4px;
    font-family: 'Playfair Display', serif;
}

.summary-sep {
    color: var(--text-dim);
}

.summary-actions {
    display: flex;
    gap: 10px;
}

/* ============ Modal ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 24, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
    animation: backdrop-enter 0.2s ease-out;
}

@keyframes backdrop-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: linear-gradient(160deg, rgba(28, 48, 84, 0.95) 0%, rgba(15, 28, 50, 0.98) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--line-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-deep), 0 0 0 1px var(--line-soft);
    animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-copper);
    opacity: 0.6;
}

.modal-box.modal-wide {
    max-width: 1000px;
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line-soft);
}

.modal-top h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all var(--transition-fast);
}
.modal-close:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.4);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line-soft);
    background: rgba(5, 11, 24, 0.4);
}

/* ============ Search Bar ============ */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(5, 11, 24, 0.5);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}
.search-bar:focus-within {
    border-color: var(--brand-copper-2);
    background: rgba(10, 22, 40, 0.7);
    box-shadow: 0 0 0 3px rgba(197, 136, 100, 0.15);
}
.search-bar svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}
.search-bar input::placeholder {
    color: var(--text-dim);
}

/* ============ Catalog Table ============ */
.catalog-table-wrap {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
}

.catalog-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.catalog-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(5, 11, 24, 0.6);
    border-bottom: 1px solid var(--line-medium);
    position: sticky;
    top: 0;
    z-index: 1;
}

.catalog-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-secondary);
}

.catalog-table tbody tr:hover {
    background: var(--surface-1);
}

/* Sortable headers */
.sortable-th {
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    transition: color var(--transition-fast), background var(--transition-fast);
    padding-right: 24px !important;
}
.sortable-th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--text-dim);
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.sortable-th:hover {
    color: var(--brand-copper-1);
    background: rgba(197, 136, 100, 0.06);
}
.sortable-th:hover::after {
    opacity: 0.4;
}
.sortable-th.sort-asc::after,
.sortable-th.sort-desc::after {
    opacity: 1;
    border-bottom-color: var(--brand-copper-1);
}
.sortable-th.sort-desc::after {
    transform: translateY(-50%) rotate(180deg);
}
.sortable-th.sort-asc,
.sortable-th.sort-desc {
    color: var(--brand-copper-1);
    background: rgba(197, 136, 100, 0.08);
}

/* ============ Status badges + filter buttons ============ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid;
    white-space: nowrap;
}
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.status-draft { background: rgba(126, 146, 181, 0.12); color: #B8C6E0; border-color: rgba(126, 146, 181, 0.35); }
.status-sent { background: rgba(197, 136, 100, 0.15); color: var(--brand-copper-1); border-color: var(--line-strong); }
.status-shipped { background: rgba(99, 130, 240, 0.15); color: #93B4FF; border-color: rgba(99, 130, 240, 0.45); }
.status-delivered { background: rgba(74, 222, 128, 0.15); color: var(--success); border-color: rgba(74, 222, 128, 0.45); }
.status-cancelled { background: rgba(248, 113, 113, 0.15); color: var(--error); border-color: rgba(248, 113, 113, 0.45); }
.status-returned { background: rgba(251, 191, 36, 0.15); color: var(--warning); border-color: rgba(251, 191, 36, 0.45); }

.status-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 14px;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.filter-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--line-medium);
}
.filter-btn.active {
    background: var(--grad-copper-soft);
    color: var(--brand-copper-1);
    border-color: var(--line-medium);
    box-shadow: 0 2px 8px rgba(197, 136, 100, 0.2);
}

/* Dashboard — stat tiles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-tile {
    background: var(--grad-card);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--grad-copper);
    transition: width var(--transition-medium);
}
.stat-tile:hover {
    transform: translateY(-2px);
    border-color: var(--line-medium);
    box-shadow: var(--shadow-medium);
}
.stat-tile:hover::before {
    width: 100%;
}
.stat-tile.accent-blue { box-shadow: 0 0 0 1px rgba(99, 130, 240, 0.15) inset; }
.stat-tile.accent-green { box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.15) inset; }
.stat-tile.accent-amber { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15) inset; }

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--grad-copper-soft);
    border: 1px solid var(--line-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-copper-1);
    margin-bottom: 12px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-tile.accent-blue .stat-icon { background: rgba(99, 130, 240, 0.12); border-color: rgba(99, 130, 240, 0.3); color: #93B4FF; }
.stat-tile.accent-green .stat-icon { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.3); color: var(--success); }
.stat-tile.accent-amber .stat-icon { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.3); color: var(--warning); }

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    background: linear-gradient(135deg, #EDF2FB 0%, #B8C6E0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-tile.accent-amber .stat-value { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Dashboard draft cards */
.draft-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.draft-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface-1);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.draft-card:hover {
    background: var(--surface-2);
    border-color: var(--line-medium);
    transform: translateX(2px);
}
.draft-card-id {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-copper-1);
    min-width: 110px;
}
.draft-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.draft-card-customer {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.draft-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}
.draft-card-meta strong {
    color: var(--brand-copper-1);
    font-weight: 600;
}
.draft-card-actions {
    display: flex;
    gap: 6px;
}

/* Empty state for dashboard */
.dashboard-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.dashboard-empty svg {
    width: 48px;
    height: 48px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

/* Order detail modal — sections */
.detail-section {
    margin-bottom: 20px;
}
.detail-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.detail-key {
    color: var(--text-muted);
    font-size: 12px;
}
.detail-val {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    text-align: right;
}
.detail-val strong {
    color: var(--brand-copper-1);
}

/* ============ Toast ============ */
.toast-area {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(160deg, rgba(28, 48, 84, 0.95) 0%, rgba(15, 28, 50, 0.98) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--line-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-deep);
    pointer-events: auto;
    min-width: 280px;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.toast-success::before { background: var(--success); box-shadow: 0 0 12px var(--success); }
.toast-error::before { background: var(--error); box-shadow: 0 0 12px var(--error); }
.toast-warning::before { background: var(--warning); box-shadow: 0 0 12px var(--warning); }

.toast-icon {
    font-size: 16px;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ Responsive ============ */
@media (max-width: 1280px) {
    .app-shell { grid-template-columns: 220px 1fr; }
    .main { padding: 28px 32px 80px; }
}
