/* ==========================================================
   Fynor ERP - Temel Arayüz Stili
   ========================================================== */

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

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f2f5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ==========================================================
   Design Tokens (29.1)
   ========================================================== */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --link: #3b82f6;
    --focus-ring: rgba(59,130,246,0.12);
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #b91c1c;
    --success: #059669;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --text-darkest: #0f172a;
    --text-dark: #1e293b;
    --text-medium: #334155;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-page: #f0f2f5;
    --bg-white: #fff;
    --bg-light: #f8fafc;
    --bg-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-light: #f1f5f9;
    --sidebar-bg: #1e293b;
    --sidebar-color: #cbd5e1;
    --sidebar-hover-bg: #334155;
    --sidebar-hover-color: #f8fafc;
    --sidebar-active-bg: var(--primary);
    --sidebar-active-color: #fff;
    --sidebar-submenu-bg: var(--text-darkest);
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 56px;
    --admin-sidebar-bg: #0b1120;
    --admin-sidebar-border: #1e293b;
    --admin-topbar-bg: #1e293b;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
    --font-size-2xs: 10px;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 13px;
    --font-size-md: 14px;
    --font-size-lg: 15px;
    --font-size-xl: 16px;
    --font-size-2xl: 18px;
    --font-size-3xl: 20px;
    --font-size-4xl: 22px;
    --font-size-5xl: 26px;
    --font-size-6xl: 28px;
    --font-size-7xl: 32px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-round: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.18);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 40px;
    --transition-fast: 0.15s;
    --transition-base: 0.2s;
    --transition-slow: 0.25s;

    /* Canonical aliases; legacy short names remain supported. */
    --color-primary: var(--primary);
    --color-primary-dark: var(--primary-hover);
    --color-primary-hover: var(--primary-hover);
    --color-primary-light: var(--primary-light);
    --color-danger: var(--danger);
    --color-danger-bg: var(--danger-bg);
    --color-success: var(--success);
    --color-success-bg: var(--success-bg);
    --color-warning: var(--warning);
    --color-warning-bg: var(--warning-bg);
    --color-info: var(--link);
    --color-info-bg: var(--primary-light);
    --color-muted: var(--text-muted);
    --color-text-primary: var(--text-dark);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-light);
    --color-text-danger: var(--danger);
    --color-background-primary: var(--bg-white);
    --color-background-secondary: var(--bg-light);
    --color-background-tertiary: var(--bg-subtle);
    --color-surface: var(--bg-white);
    --color-page-bg: var(--bg-page);
    --color-border: var(--border);
    --color-border-strong: var(--border-strong);
    --color-border-tertiary: var(--border);
    --border-radius-md: var(--radius-md);
    --border-radius-lg: var(--radius-lg);
}

/* ==========================================================
   Layout (app.php)
   ========================================================== */
#app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
#sidebar {
    width: 240px;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow: hidden;
    transition: width 0.25s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid #334155;
}

.sidebar-header-text {
    flex: 1;
    min-width: 0;
}

.sidebar-header-text h2 {
    font-size: 18px;
    color: #f8fafc;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

#sidebar-toggle:hover {
    color: #f8fafc;
}

/* Transition for smooth collapse */
#sidebar {
    transition: width 0.25s ease;
}
#main-area {
    transition: margin-left 0.25s ease;
}

/* Collapsed sidebar — via body class */
body.sidebar-collapsed #sidebar {
    width: 56px;
}

body.sidebar-collapsed .sidebar-header-text,
body.sidebar-collapsed .sidebar-tenant,
body.sidebar-collapsed .sidebar-nav ul li a > *,
body.sidebar-collapsed .has-submenu > .submenu-toggle::after,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .sidebar-nav hr {
    display: none;
}

body.sidebar-collapsed #sidebar .sidebar-nav ul li a {
    padding: 10px 0;
    text-align: center;
    font-size: 0;
    overflow: hidden;
    white-space: nowrap;
}

body.sidebar-collapsed #sidebar-toggle {
    margin: 0 auto;
}

body.sidebar-collapsed .has-submenu > .submenu {
    display: none !important;
}

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav ul li a {
    display: block;
    padding: 10px 20px;
    color: #94a3b8;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav ul li a:hover {
    background: #334155;
    color: #f8fafc;
}

.sidebar-nav ul li a.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav ul li a.active:hover {
    background: var(--primary-hover);
}

.submenu li a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.submenu li a.active:hover {
    background: var(--primary-hover);
}

.sidebar-tenant {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Submenu */
.has-submenu.open > .submenu-toggle {
    background: #1e293b;
    color: #f8fafc;
    font-weight: 600;
}

.has-submenu > .submenu-toggle::after {
    content: '▸';
    float: right;
    transition: transform 0.2s;
}

.has-submenu.open > .submenu-toggle::after {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    background: var(--text-darkest);
}

.has-submenu.open > .submenu {
    display: block;
}

.submenu li a {
    padding-left: 32px !important;
    font-size: 13px;
}

.submenu li a:hover {
    background: #1e293b;
}

.sidebar-nav hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 10px 0;
}

.logout-link {
    color: #f87171 !important;
}

/* --- Topbar --- */
#topbar {
    background: #fff;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
}

.user-info {
    font-size: 13px;
    color: #64748b;
}

/* --- Main Area --- */
#main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#content-area {
    padding: 24px;
    flex: 1;
}

/* ==========================================================
   Login Sayfası
   ========================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--text-darkest) 0%, #1e293b 50%, var(--text-darkest) 100%);
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-logo,
.login-card h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-darkest);
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #64748b;
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}

.login-demo,
.login-hint {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 20px;
}

/* ==========================================================
   Form Elemanları
   ========================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--link);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

/* ==========================================================
   Butonlar
   ========================================================== */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-block {
    width: 100%;
}

/* ==========================================================
   Uyarı Mesajları
   ========================================================== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error,
.alert.danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ==========================================================
   Dashboard Kartları
   ========================================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 8px;
}

.card p {
    color: #64748b;
    font-size: 13px;
}

/* ==========================================================
   Dashboard Grid (dashboard.php)
   ========================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.info-table td:first-child {
    color: #94a3b8;
    width: 140px;
}

.badge {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 2px 0 0;
}

.module-list {
    margin-top: 4px;
}

.module-list li {
    padding: 4px 0;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.module-list li:last-child {
    border-bottom: none;
}

.module-key {
    display: inline-block;
    background: #dbeafe;
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
}

.tenant-badge {
    display: inline-block;
    background: #1e293b;
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
    letter-spacing: 0.5px;
}

/* ==========================================================
   Admin Layout
   ========================================================== */
.admin-body {
    background: var(--text-darkest);
}

#admin-layout {
    display: flex;
    min-height: 100vh;
}

#admin-sidebar {
    width: 240px;
    background: #0b1120;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow: hidden;
    border-right: 1px solid #1e293b;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
}

.admin-sidebar-header h2 {
    font-size: 18px;
    color: #f8fafc;
}

.admin-sidebar-sub {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.admin-sidebar-nav {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-sidebar-nav .nav-label {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
}

.admin-sidebar-nav ul li a {
    display: block;
    padding: 9px 20px;
    color: #94a3b8;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.admin-sidebar-nav ul li a:hover {
    background: #1e293b;
    color: #f8fafc;
}

.admin-sidebar-nav ul li a.active {
    background: var(--primary);
    color: #fff;
}

.admin-sidebar-nav ul li a.active:hover {
    background: var(--primary-hover);
}

.admin-sidebar-nav hr {
    border: none;
    border-top: 1px solid #1e293b;
    margin: 8px 0;
}

#admin-topbar {
    background: #1e293b;
    padding: 12px 24px;
    border-bottom: 1px solid #334155;
    text-align: right;
}

.admin-user-info {
    font-size: 13px;
    color: #cbd5e1;
}

.super-badge {
    display: inline-block;
    background: #f59e0b;
    color: var(--text-darkest);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

#admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#admin-content {
    padding: 24px;
    flex: 1;
}

#admin-content h1 {
    font-size: 22px;
    color: #f8fafc;
    margin-bottom: 20px;
}

/* ==========================================================
   Admin Stats Grid
   ========================================================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-success .stat-value { color: #059669; }
.stat-warning .stat-value { color: #d97706; }
.stat-danger .stat-value { color: var(--danger); }
.stat-info .stat-value { color: var(--primary); }

.admin-dashboard-links {
    display: flex;
    gap: 12px;
}

/* ==========================================================
   Admin Tables
   ========================================================== */
.table-toolbar {
    margin-bottom: 16px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.data-table th {
    background: #f8fafc;
    padding: 10px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #991b1b;
}

.action-cell {
    white-space: nowrap;
}

.btn-sm {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: #cbd5e1;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    border-color: #94a3b8;
    color: #334155;
}

/* ==========================================================
   Admin Forms
   ========================================================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    font-family: inherit;
    background: #f8fafc;
    transition: border-color 0.25s;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--link);
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.text-muted {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ==========================================================
   Admin Alert Styles
   ========================================================== */
.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert.info {
    background: var(--primary-light);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.input-readonly {
    background: #f1f5f9 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.text-danger {
    color: var(--danger);
    font-weight: 600;
}

.badge-warning-icon {
    font-size: 14px;
    margin-left: 4px;
}

/* ==========================================================
   Tab Bar (Hesap Planı filtreleri)
   ========================================================== */
.tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.tab:hover {
    background: #f1f5f9;
    color: #334155;
}

.tab.active {
    background: var(--primary);
    color: #fff;
}

/* ==========================================================
   Placeholder
   ========================================================== */
.placeholder-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    color: #94a3b8;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Page title */
.page-title {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Form checkbox */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-group-checkbox label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

/* Permission grid */
.permission-grid {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.permission-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.permission-row:last-child {
    border-bottom: none;
}

.permission-row:hover {
    background: #f8fafc;
}

.permission-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.permission-select {
    width: 180px;
    padding: 6px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    cursor: pointer;
}

.permission-select:focus {
    outline: none;
    border-color: var(--link);
}

/* Quick links grid */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.quick-link-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.15s, box-shadow 0.15s;
    color: #334155;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: var(--primary);
}

.quick-link-card .ql-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.quick-link-card .ql-label {
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================================
   Grid / Toolbar / Modal / Tab Sistemi (Aşama 5.1)
   ========================================================== */

.grid-page {
    padding: 0;
}

.grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.grid-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-item {
    padding: 8px 18px;
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}

.tab-item:hover {
    color: var(--primary);
    background: #f8fafc;
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.grid-filter-row {
    margin-bottom: 12px;
}

.filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.grid-table th.col-check,
.grid-table td.col-check {
    width: 36px;
    text-align: center;
}

.grid-table th.col-actions,
.grid-table td.col-actions {
    width: 100px;
    text-align: center;
    white-space: nowrap;
}

.grid-row {
    transition: background 0.1s;
}

.grid-row:hover {
    background: #f8fafc;
}

.grid-row.selected {
    background: var(--primary-light);
}

.clickable {
    cursor: pointer;
    transition: color 0.1s;
}

.clickable:hover {
    color: var(--primary);
}

.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
    vertical-align: middle;
}

.action-icon:hover {
    opacity: 1;
}

/* ==========================================================
   Modal
   ========================================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-window {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.modal-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.remote-modal-state {
    padding: 40px 20px;
    border-radius: 8px;
    text-align: center;
}

.remote-modal-loading {
    color: #64748b;
    background: #f8fafc;
}

.remote-modal-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ==========================================================
   ERP Confirm Modal
   ========================================================== */

.erp-confirm-overlay {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.5);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.erp-confirm-overlay.open {
    opacity: 1;
    visibility: visible;
}

.erp-confirm-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.2s ease;
}

.erp-confirm-overlay.open .erp-confirm-modal {
    transform: scale(1) translateY(0);
}

.erp-confirm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.erp-confirm-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.erp-confirm-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.erp-confirm-close:hover {
    color: #475569;
}

.erp-confirm-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.erp-confirm-body p {
    font-size: 14px;
    color: #334155;
    margin: 0 0 12px;
    line-height: 1.5;
}

.erp-confirm-details {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.7;
}

.erp-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.erp-confirm-button {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.erp-confirm-button.secondary {
    background: #fff;
    color: #475569;
    border-color: #cbd5e1;
}

.erp-confirm-button.secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.erp-confirm-button.primary {
    color: #fff;
}

.erp-confirm-button.primary.warning {
    background: #f59e0b;
    border-color: #f59e0b;
}

.erp-confirm-button.primary.warning:hover {
    background: #d97706;
}

.erp-confirm-button.primary.danger {
    background: #ef4444;
    border-color: #ef4444;
}

.erp-confirm-button.primary.danger:hover {
    background: #dc2626;
}

.erp-confirm-button.primary.info {
    background: #3b82f6;
    border-color: #3b82f6;
}

.erp-confirm-button.primary.info:hover {
    background: #2563eb;
}

@media (max-width: 600px) {
    .erp-confirm-modal {
        max-width: calc(100% - 24px);
    }
    .erp-confirm-footer {
        flex-direction: column-reverse;
    }
    .erp-confirm-button {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================
   Modal Tabs
   ========================================================== */

.modal-grid {
    display: flex;
    flex-direction: column;
}

.modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.modal-tabs .tab-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-tabs .tab-btn:hover {
    color: var(--primary);
    background: #f8fafc;
}

.modal-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================================
   Detail Grid (Modal İçi)
   ========================================================== */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.detail-group {
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.detail-group label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 2px;
}

.detail-group span {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

/* ==========================================================
   Print page
   ========================================================== */

body.print-page {
    background: #fff;
    padding: 20px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.print-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e293b;
}

.print-header h1 {
    font-size: 20px;
    color: #1e293b;
}

.print-header h2 {
    font-size: 15px;
    color: #475569;
    margin-top: 8px;
}

.print-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    margin: 6px 0;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.print-table th,
.print-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    text-align: left;
    font-size: 11px;
}

.print-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
}

.print-table tr:nth-child(even) {
    background: #f8fafc;
}

.print-footer {
    text-align: center;
    padding: 16px;
}

/* ==========================================================
   Badge colors
   ========================================================== */

.badge-green {
    background: var(--success-bg);
    color: #166534;
}

.badge-red {
    background: #fef2f2;
    color: #991b1b;
}

/* ==========================================================
   Reports Module Styles
   ========================================================== */

.report-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.report-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.report-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.report-filter-bar {
    margin-bottom: 16px;
    padding: 16px 20px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}

.report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.report-table tbody tr:hover td {
    background: #f8fafc;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kpi-risk {
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.kpi-sub {
    font-size: 11px;
    color: #94a3b8;
}

.kpi-link {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 10px;
    color: var(--link);
    font-weight: 600;
}

.kpi-link:hover {
    text-decoration: underline;
}

/* Dashboard KPI grid — fixes overlap from absolute kpi-link */
.dashboard-kpi-grid .kpi-link {
    position: static;
    display: block;
    text-align: left;
    font-size: 10px;
    margin-top: 6px;
}
.dashboard-kpi-grid .kpi-card {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.kpi-card-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profit-positive {
    color: #059669 !important;
}

.profit-negative {
    color: var(--danger) !important;
}

/* ==========================================================
   Purchase Request (Aşama 11.1)
   ========================================================== */

.purchase-request-page {
    max-width: 100%;
    padding: 0;
}

.purchase-header-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 16px;
}

.purchase-header-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.purchase-header-fields .form-group {
    margin-bottom: 0;
}

.purchase-lines-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 16px;
}

.purchase-lines-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.purchase-lines-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.purchase-grid-wrap {
    overflow-x: auto;
    margin-bottom: 8px;
}

.purchase-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1300px;
}

/* Body-level autocomplete dropdown (escapes overflow containers) */
#fynor-autocomplete-portal {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    max-height: 280px;
    overflow-y: auto;
    display: none;
    min-width: 300px;
}

#fynor-autocomplete-portal.open {
    display: block;
}

#fynor-autocomplete-portal .autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
    white-space: nowrap;
}

#fynor-autocomplete-portal .autocomplete-item:last-child {
    border-bottom: none;
}

#fynor-autocomplete-portal .autocomplete-item:hover,
#fynor-autocomplete-portal .autocomplete-item.active {
    background: var(--primary-light);
}

#fynor-autocomplete-portal .autocomplete-item .stock-code {
    font-weight: 700;
    color: var(--primary);
}

#fynor-autocomplete-portal .autocomplete-item .stock-name {
    color: #334155;
}

#fynor-autocomplete-portal .autocomplete-item .stock-meta {
    color: #94a3b8;
    font-size: 11px;
}

#fynor-autocomplete-portal .autocomplete-item.error {
    color: var(--danger);
    cursor: default;
}

.purchase-grid thead th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.purchase-grid tbody td {
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    vertical-align: middle;
}

.purchase-grid tbody tr:hover {
    background: #f8fafc;
}

.purchase-grid tbody tr.selected {
    background: var(--primary-light);
}

.purchase-grid .col-stock {
    min-width: 300px;
}

.purchase-grid .col-unit {
    min-width: 60px;
    width: 70px;
}

.purchase-grid .col-qty {
    min-width: 80px;
    width: 90px;
}

.purchase-grid .col-price {
    min-width: 80px;
    width: 90px;
}

.purchase-grid .col-total {
    min-width: 90px;
    width: 95px;
}

.purchase-grid .col-date {
    min-width: 90px;
    width: 95px;
}

.purchase-grid .col-stock-info {
    min-width: 70px;
    width: 75px;
}

.purchase-grid .col-vendor {
    min-width: 110px;
    width: 120px;
}

.purchase-grid .col-desc {
    min-width: 100px;
    width: 120px;
}

.purchase-grid .col-action {
    width: 32px;
    text-align: center;
}

.purchase-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
}

/* Stock Combobox */
.autocomplete-wrap {
    position: relative;
    width: 100%;
}

.autocomplete-wrap::after {
    content: '\25BE';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #94a3b8;
    pointer-events: none;
    line-height: 1;
}

.autocomplete-wrap .stock-autocomplete {
    padding-right: 22px;
    cursor: default;
}

.autocomplete-wrap .stock-autocomplete:focus {
    cursor: text;
}

.autocomplete-wrap.is-open .stock-autocomplete {
    border-color: var(--link);
}

.autocomplete-wrap .stock-card-id {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.form-input-sm {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.form-select-sm {
    width: 100%;
    padding: 5px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #1e293b;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.form-select-sm:focus {
    outline: none;
    border-color: var(--link);
}

.input-readonly {
    background: #f8fafc;
    color: #64748b;
}

.numeric-cell {
    text-align: right;
}

.readonly-cell {
    background: #f8fafc;
    color: #64748b;
    pointer-events: none;
}

.btn-remove-line {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.btn-remove-line:hover {
    opacity: 1;
}

/* Purchase Request Error Styles (Aşama 11.6) */

.purchase-line-error {
    background: #fff1f2 !important;
}

.purchase-line-error .field-error {
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
}

.field-error-message {
    color: #b91c1c;
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.3;
}

/* ==========================================================
   Global ERP UI Standard Classes (Aşama 12)
   ========================================================== */

.erp-page {
    padding: 0;
}

.erp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.erp-filter-bar {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.erp-filter-bar .filter-row {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}

.erp-filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-filter-bar .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.erp-filter-bar .filter-group input,
.erp-filter-bar .filter-group select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    min-width: 120px;
}

.erp-filter-bar .filter-group input:focus,
.erp-filter-bar .filter-group select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.erp-table-wrap {
    overflow-x: auto;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.erp-table th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.erp-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    vertical-align: middle;
}

.erp-table tbody tr:hover {
    background: #f8fafc;
}

.erp-table-compact th {
    padding: 6px 8px;
    font-size: 12px;
}

.erp-table-compact td {
    padding: 4px 8px;
    font-size: 12px;
}

.erp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.erp-badge-success {
    background: var(--success-bg);
    color: #166534;
}

.erp-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.erp-badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

.erp-badge-muted {
    background: #f1f5f9;
    color: #94a3b8;
}

.erp-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

.erp-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 32px 16px;
    font-size: 13px;
}

.erp-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
    overflow: hidden;
}

.erp-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.erp-section-body {
    padding: 16px;
}

.erp-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 24px;
    font-size: 13px;
    line-height: 1.7;
}

.erp-summary-grid .label {
    color: #64748b;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.erp-summary-grid .value {
    color: #1e293b;
}

.erp-kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}

.erp-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ==========================================================
   Doküman Viewer (docs/view.php)
   ========================================================== */

.doc-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.doc-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 0;
    position: sticky;
    top: 80px;
}

.doc-sidebar-title {
    padding: 0 16px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
}

.doc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-sidebar li {
    margin: 0;
}

.doc-nav-link {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.doc-nav-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.doc-nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.doc-main {
    flex: 1;
    min-width: 0;
}

.doc-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 32px 40px;
    line-height: 1.7;
    color: #1e293b;
}

.doc-content h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    color: var(--text-darkest);
}

.doc-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text-darkest);
}

.doc-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: #1e293b;
}

.doc-content p {
    margin: 0 0 10px;
}

.doc-paragraph {
    margin-bottom: 8px;
}

.doc-content ul {
    list-style: disc;
    padding-left: 24px;
    margin: 8px 0 12px;
}

.doc-content ul li {
    margin-bottom: 4px;
}

.doc-content ul.doc-checklist {
    list-style: none;
    padding-left: 0;
}

.doc-content ul.doc-checklist li {
    padding: 3px 0;
}

.doc-content ul.doc-checklist li.checked {
    color: #64748b;
}

.doc-content ul.doc-checklist li.unchecked {
    color: #1e293b;
}

.doc-code {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

.code-lang {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    padding: 4px 0 0 4px;
}

.doc-inline-code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.doc-table th {
    background: #f8fafc;
    font-weight: 700;
    text-align: left;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    color: var(--text-darkest);
}

.doc-table td {
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .doc-layout {
        flex-direction: column;
    }
    .doc-sidebar {
        width: 100%;
        position: static;
        top: auto;
    }
    .doc-card {
        padding: 20px;
    }
}

/* ===== AI Belge Okuma ===== */
.ai-doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.ai-doc-toolbar h1 {
    margin: 0;
    font-size: 1.4rem;
}
.ai-doc-preview {
    max-width: 100%;
    max-height: 320px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ai-doc-preview:hover {
    opacity: 0.9;
}
.ai-doc-empty {
    text-align: center;
    padding: 48px 20px;
    color: #64748b;
}
.ai-doc-warning {
    background: #fef9c3;
    border: 1px solid #facc15;
    border-left: 4px solid #eab308;
    border-radius: 6px;
    padding: 14px 16px;
    color: #713f12;
    font-size: 13px;
    line-height: 1.5;
}
.ai-doc-warning strong {
    color: #92400e;
}
.ai-doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 768px) {
    .ai-doc-toolbar {
        flex-direction: column;
    }
    .ai-doc-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Sidebar Scroll (Aşama 27.3)
   ========================================================== */
#sidebar {
    overflow: hidden;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
body.sidebar-collapsed .sidebar-nav {
    overflow-y: visible;
}

/* ==========================================================
   Global Utility Bar (Aşama 27.3)
   ========================================================== */
.app-utility-bar {
    display: flex;
    gap: 4px;
    padding: 6px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.util-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    font-family: inherit;
}
.util-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

/* ==========================================================
   Breadcrumb (Aşama 27.3)
   ========================================================== */
.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 24px 0;
    font-size: 12px;
    color: #64748b;
    flex-wrap: wrap;
}
.app-breadcrumb a {
    color: var(--link);
    text-decoration: none;
}
.app-breadcrumb a:hover {
    text-decoration: underline;
}
.app-breadcrumb .bc-sep {
    color: #94a3b8;
    margin: 0 3px;
    font-size: 14px;
}
.app-breadcrumb .bc-current {
    color: #1e293b;
    font-weight: 600;
}

/* ==========================================================
   Scroll to Top Button (Aşama 27.3)
   ========================================================== */
.scroll-top-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1e293b;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9998;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-top-button.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-top-button:hover {
    background: #334155;
    transform: translateY(-2px);
}

/* ==========================================================
   Flash Message Close / Auto-Dismiss (Aşama 27.3)
   ========================================================== */
.alert {
    position: relative;
    padding-right: 36px;
}
.flash-close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 2px 4px;
    line-height: 1;
    transition: opacity 0.15s;
}
.flash-close:hover {
    opacity: 1;
}

/* ==========================================================
   Form Loading ve Çift Submit (Aşama 27.3)
   ========================================================== */
.btn-loading,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
button:disabled .btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spin 0.7s linear infinite;
    vertical-align: middle;
}

/* ==========================================================
   Page Loading Inline (Aşama 27.3)
   ========================================================== */
.page-loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: #64748b;
    font-size: 14px;
}

/* ==========================================================
   Tablo İyileştirmeleri (Aşama 27.3)
   ========================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}
.table-sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}
.table-sticky-header thead th::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    border-bottom: 2px solid #e2e8f0;
}
.erp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table th,
.erp-table th,
.grid-table th {
    white-space: nowrap;
}
.erp-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

/* ==========================================================
   Form Hata Gösterimi (Aşama 27.3)
   ========================================================== */
.field-error {
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
}
.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}
.form-error-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #991b1b;
    font-size: 13px;
}
.form-error-summary ul {
    margin: 6px 0 0 16px;
    padding: 0;
}
.form-error-summary li {
    margin-bottom: 3px;
}
.form-group .required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 700;
}
label.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 700;
}

/* ==========================================================
   Sticky Page Actions (Aşama 27.3 — opsiyonel)
   ========================================================== */
.sticky-page-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

/* ==========================================================
   Page Header Modern (Aşama 28.3.1)
   ========================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header-info h1.page-title {
    margin-bottom: 4px;
}

.page-header-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.page-header-count {
    display: inline-block;
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ==========================================================
   Text Alignment Utilities
   ========================================================== */

.text-right {
    text-align: right;
}

.fw-600 {
    font-weight: 600;
}

/* ==========================================================
   Invoice Status Badges (Aşama 28.3.1)
   ========================================================== */

.status-badge-draft {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}

.status-badge-posted {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--success-bg);
    color: #166534;
}

.status-badge-cancelled {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #fef2f2;
    color: #991b1b;
}

/* ==========================================================
   Empty State (Aşama 28.3.1)
   ========================================================== */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state .empty-state-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.empty-state .empty-state-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.empty-state .empty-state-desc {
    font-size: 13px;
    color: #94a3b8;
}

/* ==========================================================
   Table Actions (Aşama 28.3.1)
   ========================================================== */

.table-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

.table-actions .btn-sm {
    padding: 3px 8px;
    font-size: 11px;
    white-space: nowrap;
}

/* ==========================================================
   Filter Grid (Aşama 28.3.1)
   ========================================================== */

.filter-row {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-row .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 2px;
}

.filter-row .filter-group input,
.filter-row .filter-group select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    min-width: 120px;
}

.filter-row .filter-group input:focus,
.filter-row .filter-group select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

/* ==========================================================
   KPI Card in List Context (Aşama 28.3.1)
   ========================================================== */

.kpi-grid {
    margin-bottom: 16px;
}

/* ==========================================================
   Body modal open (Aşama 27.3)
   ========================================================== */
body.body-modal-open {
    overflow: hidden;
}

/* ==========================================================
   is-dirty class (Aşama 27.3)
   ========================================================== */
form.is-dirty {
    /* indicator only, no visual change needed */
}

/* ==========================================================
   AI Process Overlay (Aşama 27.2.3)
   ========================================================== */
.ai-process-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.4);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.ai-process-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 90%;
}

.ai-process-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

.ai-process-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.ai-process-sub {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.5;
}

.ai-process-note {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

/* AI Process Message */
.ai-process-message {
    margin-bottom: 16px;
}

.ai-process-message .alert {
    margin-bottom: 0;
}

/* Upload button spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ai-spin 0.7s linear infinite;
    vertical-align: middle;
}

/* Disabled button state */
.is-loading,
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================
   AI Document Review Template
   ========================================================== */

.ai-doc-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #92400e;
}

.ai-doc-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.info-table td {
    padding: 5px 8px;
    vertical-align: top;
}

.info-table td:first-child {
    color: #64748b;
    white-space: nowrap;
    width: 120px;
}

.sc-input {
    min-width: 180px;
}

/* Stock combobox dropdown */
#sc-portal {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
    min-width: 280px;
}

#sc-portal.open {
    display: block;
}

#sc-portal .sc-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    line-height: 1.4;
}

#sc-portal .sc-item:last-child {
    border-bottom: none;
}

#sc-portal .sc-item:hover,
#sc-portal .sc-item.active {
    background: var(--primary-light);
    color: var(--primary-hover);
}

#sc-portal .sc-item .sc-code {
    font-weight: 600;
    color: #1e293b;
}

#sc-portal .sc-item .sc-name {
    color: #64748b;
    display: block;
    font-size: 11px;
}

#sc-portal .sc-item .sc-meta {
    color: #94a3b8;
    font-size: 10px;
}

#sc-portal .sc-empty {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

.stock-combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 240px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
}

.stock-combobox-dropdown.active {
    display: block;
}

.stock-combobox-dropdown .sc-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    line-height: 1.4;
}

.stock-combobox-dropdown .sc-item:last-child {
    border-bottom: none;
}

.stock-combobox-dropdown .sc-item:hover,
.stock-combobox-dropdown .sc-item.highlighted {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.stock-combobox-dropdown .sc-item .sc-code {
    font-weight: 600;
    color: #1e293b;
}

.stock-combobox-dropdown .sc-item .sc-name {
    color: #64748b;
    display: block;
    font-size: 11px;
}

.stock-combobox-dropdown .sc-item .sc-conf {
    color: #059669;
    font-size: 11px;
}

/* Account combobox dropdown (AI Review) */
#ac-portal {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
    min-width: 280px;
}

#ac-portal.open {
    display: block;
}

#ac-portal .ac-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    line-height: 1.4;
}

#ac-portal .ac-item:last-child {
    border-bottom: none;
}

#ac-portal .ac-item:hover,
#ac-portal .ac-item.active {
    background: var(--primary-light);
    color: var(--primary-hover);
}

#ac-portal .ac-item .ac-code {
    font-weight: 600;
    color: #1e293b;
}

#ac-portal .ac-item .ac-name {
    color: #64748b;
    font-size: 11px;
}

#ac-portal .ac-empty {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ==========================================================
   AI Document Review Header (Aşama 28.1)
   ========================================================== */

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.review-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.review-header-right {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.review-meta {
    font-size: 12px;
    color: #64748b;
}

.review-meta .badge {
    font-size: 11px;
    padding: 1px 8px;
}

.doc-shortcut {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.doc-shortcut:hover {
    color: var(--primary-hover);
}

.ai-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

/* Mobile */
@media (max-width: 600px) {
    .ai-form-grid {
        grid-template-columns: 1fr;
    }

    .ai-process-box {
        padding: 28px 24px;
    }

    .ai-doc-warning {
        font-size: 12px;
        padding: 10px 14px;
    }

    .info-table td:first-child {
        width: 90px;
    }

    .review-header {
        flex-direction: column;
        align-items: stretch;
    }

    .review-header-right {
        justify-content: flex-start;
    }
}

/* ==========================================================
   Invoice Detail (Aşama 28.1.8)
   ========================================================== */

.document-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.document-title-block h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-darkest);
}

.document-title-block .document-meta {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.document-title-block .document-meta strong {
    color: #475569;
}

.document-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.document-header-right .document-grand-total {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-darkest);
    white-space: nowrap;
}

.document-header-right .document-grand-total .currency {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin-left: 4px;
}

.document-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.document-action-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.document-action-bar .action-spacer {
    flex: 1;
}

.invoice-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.invoice-info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.invoice-info-card .card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.invoice-info-card .card-body {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
}

.invoice-info-card .card-body .info-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.invoice-info-card .card-body .info-row .label {
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.invoice-info-card .card-body .info-row .value {
    color: #1e293b;
    text-align: right;
    font-weight: 500;
}

.invoice-info-card .card-body .info-row .value.total-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-darkest);
}

.invoice-total-card .card-body .info-row .value {
    font-weight: 600;
}

.invoice-total-card .card-body .info-row.grand-total {
    border-top: 2px solid #e2e8f0;
    margin-top: 4px;
    padding-top: 6px;
}

.invoice-total-card .card-body .info-row.grand-total .label,
.invoice-total-card .card-body .info-row.grand-total .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-darkest);
}

.invoice-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
    padding: 0 0 0 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.invoice-tab-btn {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.invoice-tab-btn:hover {
    color: #1e293b;
    background: #f8fafc;
}

.invoice-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #f8fafc;
}

.invoice-tab-panel {
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.invoice-tab-panel.active {
    display: block;
}

.invoice-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.invoice-entry-lines {
    min-width: 1280px;
}

.invoice-entry-lines .invoice-stock-column {
    min-width: 300px;
}

.invoice-entry-lines .invoice-description-column {
    min-width: 240px;
}

.invoice-document-lines {
    min-width: 1120px;
}

.invoice-document-lines th:nth-child(3),
.invoice-document-lines td:nth-child(3) {
    min-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.invoice-document-lines th:nth-child(4),
.invoice-document-lines td:nth-child(4) {
    min-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.current-account-statement-table {
    /* Additional override for statement description column */
}

.current-account-statement-table .statement-description-column,
.current-account-statement-table .statement-description {
    word-break: break-word;
    white-space: pre-line;
}

/* Current account detail word-break for long text values */
.ca-word-break {
    word-break: break-word;
    white-space: pre-line;
}

/* Current account modal card sections */
.ca-modal-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ca-modal-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ca-balance-value {
    font-weight: 700;
    font-size: 16px;
}

.ca-balance-dir {
    font-weight: 500;
    font-size: 12px;
    opacity: 0.75;
    margin-left: 4px;
}

@media (max-width: 640px) {
    .ca-modal-sections {
        grid-template-columns: 1fr;
    }
}

.invoice-lines-table thead th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 8px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.invoice-lines-table tbody td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    vertical-align: middle;
}

.invoice-lines-table tbody tr:hover {
    background: #f8fafc;
}

.invoice-lines-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.invoice-lines-table .center {
    text-align: center;
}

.invoice-lines-table tfoot td {
    border: 1px solid #e2e8f0;
    padding: 8px;
    font-weight: 700;
    font-size: 12px;
}

.invoice-lines-table tfoot .total-label {
    text-align: right;
    color: #1e293b;
}

.invoice-lines-table tfoot .total-value {
    text-align: right;
    color: var(--text-darkest);
}

.invoice-lines-table tfoot .grand-total-row td {
    font-size: 14px;
    border-top: 2px solid #cbd5e1;
}

.invoice-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
}

.invoice-empty-state .empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.invoice-empty-state .empty-title {
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .document-detail-header {
        flex-direction: column;
    }
    .document-header-right {
        align-items: flex-start;
        width: 100%;
    }
    .invoice-summary-grid {
        grid-template-columns: 1fr;
    }
    .invoice-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

.invoice-form-card {
    background: var(--color-background-primary);
    border: 1px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.form-section {
    margin-bottom: 24px;
}
.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-tertiary);
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.required {
    color: var(--color-text-danger);
}
.invoice-totals-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.invoice-totals-box {
    min-width: 260px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}
.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border-tertiary);
}
.totals-row:last-child {
    border-bottom: none;
}
.totals-grand {
    font-size: 15px;
    background: var(--color-background-secondary);
    padding: 10px 14px;
}
.totals-label {
    color: var(--color-text-secondary);
}
.totals-value {
    font-weight: 600;
}
@media (max-width: 768px) {
    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .invoice-form-card {
        padding: 16px;
    }
}

/* ==========================================================
   Kullanıcı Formu (Aşama 28.6.8)
   ========================================================== */
.user-form-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.user-form-card {
    flex: 1;
    max-width: 600px;
}
.role-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.role-checkbox-grid .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
}
.role-checkbox-grid .checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.role-checkbox-grid .checkbox-inline small {
    color: #94a3b8;
    font-size: 11px;
    margin-left: 2px;
}
.role-summary-panel {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}
.role-summary-panel h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.role-summary-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.role-summary-item strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}
.role-summary-item span {
    display: block;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.role-summary-note {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}
.role-summary-note a {
    color: var(--primary);
    text-decoration: underline;
}
@media (max-width: 900px) {
    .user-form-layout {
        flex-direction: column;
    }
    .role-summary-panel {
        width: 100%;
    }
    .role-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Compact Data Grid (28.6.11 - My Approvals)
   ========================================================== */
.data-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-grid {
    min-width: 1300px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    width: 100%;
}
.data-grid th {
    background: #f8fafc;
    padding: 7px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.data-grid td {
    padding: 6px 8px;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.data-grid tr:last-child td {
    border-bottom: none;
}
.data-grid tr:hover td {
    background: #f8fafc;
}
.data-grid .col-cb {
    width: 34px;
    text-align: center;
}
.data-grid .col-cb input {
    margin: 0;
    vertical-align: middle;
}
.data-grid .col-rno {
    width: 105px;
}
.data-grid .col-date {
    width: 85px;
}
.data-grid .col-time {
    width: 65px;
}
.data-grid .col-req {
    width: 120px;
}
.data-grid .col-wh {
    width: 95px;
}
.data-grid .col-pri {
    width: 65px;
}
.data-grid .col-amt {
    width: 95px;
    text-align: right;
}
.data-grid .col-lvl {
    width: 65px;
}
.data-grid .col-notes {
    min-width: 110px;
    max-width: 170px;
}
.data-grid .col-detail {
    min-width: 130px;
    max-width: 210px;
}
.data-grid .col-expand {
    width: 28px;
    text-align: center;
}
.data-grid .col-items {
    min-width: 150px;
    max-width: 250px;
}
.data-grid .col-actions {
    width: 60px;
    text-align: center;
}
.data-grid td.col-notes,
.data-grid td.col-detail {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 12px;
}
.bulk-bar textarea {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    min-height: 32px;
    resize: vertical;
}
.bulk-bar .bulk-count {
    color: #64748b;
    white-space: nowrap;
    font-size: 11px;
}

/* ==========================================================
   Reusable Compact Table Variant (28.6.12)
   ========================================================== */
.data-table.compact th {
    padding: 7px 8px;
    font-size: 11px;
}
.data-table.compact td {
    padding: 6px 8px;
    font-size: 12px;
}
.erp-text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.erp-text-truncate--sm {
    max-width: 120px;
}
.erp-text-truncate--lg {
    max-width: 300px;
}

/* ==========================================================
   ERP Grid Scroll + Expand Rows (28.6.12B)
   ========================================================== */
.erp-grid-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}
.erp-grid {
    width: 100%;
    min-width: 1500px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.erp-grid--wide {
    min-width: 1800px;
}
.erp-grid thead th {
    background: #f8fafc;
    padding: 7px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.erp-grid tbody td {
    padding: 6px 10px;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
    vertical-align: middle;
}
.erp-grid tbody tr:last-child td,
.erp-grid tbody tr:last-of-type td {
    border-bottom: none;
}
.erp-grid tbody tr:hover td {
    background: #f8fafc;
}
.erp-grid .erp-text-clip {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.erp-grid .erp-text-clip--sm {
    max-width: 140px;
}
.erp-grid .erp-text-clip--lg {
    max-width: 320px;
}
.erp-grid .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.erp-grid .col-expand {
    width: 28px;
    text-align: center;
}
.erp-grid .col-cb {
    width: 34px;
    text-align: center;
}
.erp-grid .col-cb input {
    margin: 0;
    vertical-align: middle;
}

/* Text clip (standalone, works across all table types) */
.erp-text-clip {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.erp-text-clip--sm {
    max-width: 140px;
}
.erp-text-clip--lg {
    max-width: 320px;
}

/* Expand / collapse toggle button */
.erp-row-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    color: #94a3b8;
    transition: color 0.15s, transform 0.15s;
    width: 24px;
    text-align: center;
    line-height: 1;
}
.erp-row-toggle:hover {
    color: var(--primary);
}
.erp-row-toggle.open {
    color: var(--primary);
}

/* Detail expand row */
.erp-row-detail {
    display: none;
}
.erp-row-detail.open {
    display: table-row;
}
.erp-row-detail td {
    padding: 0 !important;
    background: #f8fafc !important;
}
.erp-row-detail-box {
    padding: 10px 16px 10px 44px;
    border-bottom: 1px solid #e2e8f0;
}

/* Mini grid inside expand row */
.erp-mini-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.erp-mini-grid thead th {
    background: #e2e8f0;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-align: left;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.erp-mini-grid tbody td {
    padding: 3px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    white-space: nowrap;
    font-size: 12px;
    background: #fff !important;
}
.erp-mini-grid tbody tr:last-child td {
    border-bottom: none;
}
.erp-mini-grid tbody tr:hover td {
    background: #f8fafc !important;
}
.erp-mini-grid .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.erp-mini-grid .center {
    text-align: center;
}

/* ==========================================================
   ERP UI Primitives (29.1)
   Additive, backward-compatible classes for 29.2+ migrations.
   ========================================================== */
.erp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.erp-page-title {
    margin: 0;
    color: var(--color-text-primary);
    font-size: var(--font-size-4xl);
    line-height: 1.25;
}

.erp-page-subtitle {
    margin: var(--space-xs) 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.erp-page-actions,
.erp-grid-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.erp-page-actions {
    flex-shrink: 0;
}

.erp-filter-card,
.erp-card,
.erp-form-section {
    background: var(--color-background-primary);
    border: 1px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-lg);
}

.erp-filter-card {
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

.erp-card,
.erp-form-section {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.erp-grid-shell {
    width: 100%;
    max-width: 100%;
    background: var(--color-background-primary);
    border: 1px solid var(--color-border-tertiary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.erp-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-border-tertiary);
    flex-wrap: wrap;
}

.erp-grid-shell > .erp-grid-scroll {
    margin-bottom: 0;
}

.erp-grid-actions {
    white-space: nowrap;
}

.erp-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-sm);
    border-radius: var(--radius-round);
    background: var(--bg-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.erp-status-badge.success,
.erp-status-badge--success,
.erp-status-badge.is-success {
    background: var(--color-success-bg);
    color: var(--success-text);
}

.erp-status-badge.warning,
.erp-status-badge--warning,
.erp-status-badge.is-warning {
    background: var(--color-warning-bg);
    color: var(--warning-text);
}

.erp-status-badge.danger,
.erp-status-badge--danger,
.erp-status-badge.is-danger {
    background: var(--color-danger-bg);
    color: var(--danger-text);
}

.erp-status-badge.info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.erp-status-badge.muted,
.erp-status-badge--muted,
.erp-status-badge.is-muted {
    background: var(--bg-subtle);
    color: var(--color-muted);
}

/* ==========================================================
   ERP Grid Standard v2 (30.4A)
   ========================================================== */

.erp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.erp-toolbar-left,
.erp-toolbar-right {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.erp-filter-grid {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}

.erp-filter-grid .filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-filter-grid .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
}

.erp-filter-grid .filter-group input,
.erp-filter-grid .filter-group select {
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    min-width: 100px;
}

.erp-filter-grid .filter-group input:focus,
.erp-filter-grid .filter-group select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.erp-grid-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 16px;
}

.erp-grid-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.erp-grid-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.erp-grid-meta {
    font-size: 11px;
    color: #94a3b8;
}

.erp-grid-tools {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.erp-grid-search input {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    min-width: 140px;
}

.erp-grid-search input:focus {
    outline: none;
    border-color: var(--link);
}

.erp-grid-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.erp-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.erp-grid-table thead th {
    background: #f8fafc;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.erp-grid-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.erp-grid-table tbody tr:hover td {
    background: #f8fafc;
}

.erp-grid-table tbody tr:nth-child(even) td {
    background: #fcfcfd;
}

.erp-grid-table tbody tr:nth-child(even):hover td {
    background: #f1f5f9;
}

.erp-grid-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.erp-grid-table .center {
    text-align: center;
}

.erp-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
    flex-wrap: wrap;
}

.erp-grid-summary-row td {
    font-weight: 600;
    background: #f8fafc !important;
    border-top: 2px solid #e2e8f0;
    padding: 7px 10px;
    font-size: 12px;
}

.erp-grid-empty {
    text-align: center;
    padding: 40px 16px;
    color: #94a3b8;
    font-size: 13px;
}

.erp-action-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.erp-action-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.erp-action-button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.erp-action-button.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.erp-action-button.secondary {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.erp-action-button.success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.erp-action-button.success:hover {
    background: #059669;
    border-color: #059669;
}

.erp-action-button.warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.erp-action-button.warning:hover {
    background: #b45309;
    border-color: #b45309;
}

.erp-action-button.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.erp-action-button.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.erp-action-button:disabled,
.erp-action-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.erp-action-button.small {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Dashboard quick cards */
.erp-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.erp-quick-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    color: #334155;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.erp-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: var(--primary);
}

.erp-quick-card .q-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.erp-quick-card .q-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.erp-quick-card .q-desc {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Section title */
.erp-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .erp-page-header,
    .erp-grid-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .erp-page-actions,
    .erp-grid-actions {
        width: 100%;
    }

    .erp-page-actions .btn,
    .erp-grid-actions .btn {
        max-width: 100%;
    }

    .erp-quick-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
}

/* ==========================================================
   Sales Desk (30.4B)
   ========================================================== */

.desk-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.desk-opbar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.desk-opbar-main {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.desk-opbar-barcode {
    flex: 3;
    min-width: 260px;
    display: flex;
    gap: 6px;
}

.desk-opbar-barcode input {
    flex: 1;
    font-size: 15px;
    padding: 9px 12px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    background: #f8faff;
    outline: none;
    font-family: inherit;
}

.desk-opbar-barcode input:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.desk-opbar-barcode .erp-action-button {
    padding: 9px 20px;
    font-size: 13px;
    white-space: nowrap;
}

.desk-opbar-currency {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.desk-opbar-currency label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.desk-opbar-currency select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-weight: 600;
}

.desk-opbar-rate {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.desk-opbar-actions {
    flex-shrink: 0;
    align-self: flex-end;
}

.desk-opbar-sub {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.desk-opbar-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}

.desk-opbar-check input {
    accent-color: var(--primary);
}

.desk-opbar-sub input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
}

.desk-opbar-sub input[type="text"]:focus {
    outline: none;
    border-color: var(--link);
}

.desk-opbar-meta {
    font-size: 11px;
    color: #94a3b8;
}

/* POS viewport layout — full-height, internal scroll only */
.desk-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.desk-opbar {
    flex: none;
}

.desk-body {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.desk-products {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.desk-products-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.desk-products-card .erp-grid-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
}

.desk-products-card .erp-grid-table th,
.desk-products-card .erp-grid-table td {
    padding: 6px 4px;
    font-size: 11px;
}

.desk-products-card .erp-grid-table th:nth-child(2),
.desk-products-card .erp-grid-table td:nth-child(2) {
    min-width: 120px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desk-rightcol {
    flex: 1.2;
    min-width: 280px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.desk-cart {
    flex: 1;
    min-height: 0;
    min-width: 0;
    max-width: none;
    position: static;
}

.desk-cart-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.desk-cart-card .desk-cart-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.desk-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.desk-cart-scroll .erp-grid-table th,
.desk-cart-scroll .erp-grid-table td {
    padding: 5px 3px;
    font-size: 11px;
    vertical-align: middle;
}

.desk-cart-scroll .erp-grid-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
}

.desk-cart-scroll .erp-grid-table td:first-child {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
}

.desk-cart-scroll .erp-grid-table td:first-child strong {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desk-cart-scroll .erp-grid-table td:first-child span {
    display: block;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desk-cart-totals {
    flex: none;
}

.desk-cart-totals {
    border-top: 2px solid #e2e8f0;
    padding: 10px 14px;
    background: #f8fafc;
}

.desk-cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 3px;
}

.desk-cart-total-row.desk-cart-grand {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    border-top: 1px solid #cbd5e1;
    padding-top: 6px;
    margin-top: 3px;
    margin-bottom: 0;
}

.desk-cart-total-row.desk-cart-grand span:last-child {
    color: var(--primary);
}

.desk-total-negative {
    color: var(--danger) !important;
}

.desk-cart-actions {
    padding: 10px 14px 6px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.desk-cart-note {
    font-size: 10px;
    color: #94a3b8;
    padding: 0 14px 10px;
    text-align: center;
}

/* Cart quantity group */
.desk-qty-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.desk-qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.1s;
    padding: 0;
    font-family: inherit;
}

.desk-qty-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.desk-qty-input {
    width: 48px;
    text-align: center;
    padding: 3px 2px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
}

.desk-qty-input:focus,
.desk-price-input:focus,
.desk-disc-input:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 1px var(--link);
}

.desk-qty-input.warn {
    border-color: #dc2626;
    background: #fef2f2;
}

.desk-price-input {
    width: 72px;
    text-align: right;
    padding: 3px 4px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
}

.desk-price-input.warn {
    border-color: #f59e0b;
    background: #fffbeb;
}

.desk-disc-input {
    width: 48px;
    text-align: center;
    padding: 3px 2px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
}

.desk-price-pill {
    font-weight: 700;
    color: #1e293b;
    cursor: default;
    user-select: text;
    display: inline-block;
    padding: 4px 0;
    font-size: 12px;
}

.desk-price-pill.warn {
    color: #f59e0b;
}

.desk-vat-pct {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.desk-vat-amount {
    display: inline-block;
    font-size: 10px;
    color: #94a3b8;
}

.desk-cart-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 16px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.15s;
    font-family: inherit;
}

.desk-cart-remove:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* Add-to-cart button in product table */
.btn-add-cart {
    width: 30px;
    height: 28px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: #fff;
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    font-family: inherit;
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-add-cart:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #94a3b8;
    color: #94a3b8;
}

/* Payment panel */
.desk-payment {
    flex: none;
}

.desk-payment-card {
    padding: 0;
}

.desk-payment-header {
    padding: 12px 14px 8px;
    border-bottom: 1px solid #e2e8f0;
}

.desk-payment-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.desk-payment-subtitle {
    display: block;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.desk-payment-section {
    padding: 8px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.desk-payment-section:last-child {
    border-bottom: none;
}

.desk-payment-section-title {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Payment method buttons (interactive) */
.desk-payment-methods {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.desk-payment-method {
    flex: 1;
    min-width: 72px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.desk-payment-method:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.desk-payment-method.active {
    border-color: var(--primary);
    background: #f0f7ff;
    color: var(--primary);
    font-weight: 700;
}

/* Payment detail sections */
.desk-payment-detail {
    padding: 10px 14px;
    border-top: 1px solid #e2e8f0;
    background: #fafcff;
}

.desk-payment-detail-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
}

.desk-payment-detail-row:last-child {
    margin-bottom: 0;
}

.desk-payment-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.desk-payment-detail-input {
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.12s;
}

.desk-payment-detail-input:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 1px var(--link);
}

.desk-payment-detail-input::placeholder {
    color: #94a3b8;
}

.desk-payment-detail-select {
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
    outline: none;
}

.desk-payment-detail-note {
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 4px;
    line-height: 1.4;
}

/* Payment summary rows */
.desk-payment-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.desk-payment-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

.desk-payment-value {
    font-weight: 600;
    color: #1e293b;
}

.desk-payment-remaining {
    color: var(--danger);
}

/* Currency badges */
.desk-payment-currency-info {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.desk-payment-currency-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #94a3b8;
    background: #f8fafc;
}

.desk-payment-currency-badge.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7ff;
}

.desk-payment-currency-note {
    width: 100%;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Split payment placeholder */
.desk-payment-split-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
}

.desk-payment-split-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 11px;
}

.desk-payment-split-label {
    flex: 1;
    font-weight: 600;
    color: #334155;
    font-size: 11px;
}

.desk-payment-split-amount {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    font-size: 11px;
}

.desk-payment-split-remove {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.1s, color 0.1s;
}

.desk-payment-split-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

.desk-payment-split-placeholder {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 0;
    text-align: center;
}

.desk-payment-split-actions {
    margin-bottom: 4px;
}

.desk-payment-split-actions .erp-action-button {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
}

/* Sale note between cart and payment */
.desk-note {
    flex: none;
}

.desk-note-card {
    padding: 0;
}

.desk-note-header {
    padding: 10px 14px 0;
}

.desk-note-body {
    padding: 8px 14px 12px;
}

.desk-note-textarea {
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
    resize: vertical;
    outline: none;
    transition: border-color 0.12s;
}

.desk-note-textarea:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 1px var(--link);
}

.desk-note-textarea::placeholder {
    color: #94a3b8;
}

/* Invoice timing (now/later radios) */
.desk-invoice-timing {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.desk-invoice-timing-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}

.desk-invoice-timing-option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.desk-invoice-timing-option input[type="radio"] {
    accent-color: var(--primary);
    flex-shrink: 0;
}

.desk-invoice-timing-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.desk-invoice-timing-note {
    margin-top: 6px;
}

.desk-timing-note-now,
.desk-timing-note-later {
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.4;
}

/* Action section at bottom of payment card */
.desk-payment-section-actions {
    padding: 12px 14px;
    border-bottom: none;
}

.desk-payment-form {
    margin: 0;
}

.desk-payment-notes {
    padding: 6px 14px 12px;
    border-bottom: none;
}

.desk-sale-action-note {
    font-size: 10px;
    color: #d97706;
    line-height: 1.4;
    margin-bottom: 4px;
}

.desk-sale-action-roadmap {
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.4;
}

/* POS viewport � medium screens */
@media (max-width: 1050px) {
    .desk-rightcol {
        min-width: 240px;
        max-width: 360px;
    }
}

/* Mobile */
@media (max-width: 900px) {
    .desk-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .desk-rightcol {
        flex: none;
        max-width: none;
        width: 100%;
        overflow-y: visible;
    }

    .desk-cart-scroll {
        max-height: 240px;
    }

    .desk-products-card .erp-grid-table-wrap {
        flex: none;
        max-height: 300px;
        overflow-y: auto;
    }

    .desk-rightcol .desk-cart {
        flex: none;
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .desk-cart {
        flex: none;
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .desk-opbar-main {
        flex-direction: column;
        align-items: stretch;
    }

    .desk-opbar-barcode {
        flex: none;
        min-width: 0;
    }

    .desk-opbar-barcode input {
        font-size: 16px;
    }

    .desk-opbar-currency {
        align-self: flex-start;
    }

    .desk-opbar-sub {
        flex-direction: column;
        align-items: stretch;
    }

    .desk-opbar-sub input[type="text"] {
        min-width: 0;
    }

    .desk-cart-actions {
        flex-direction: column;
    }

    .desk-cart-actions .erp-action-button {
        width: 100%;
        justify-content: center;
    }

    .desk-note-textarea {
        font-size: 16px;
    }

    .desk-payment-method {
        min-width: 0;
        padding: 10px 6px;
        font-size: 12px;
    }

    .desk-payment-detail-input {
        font-size: 16px;
        padding: 10px 12px;
    }

    .desk-payment-detail-select {
        font-size: 16px;
        padding: 10px 12px;
    }

    .desk-invoice-timing-option {
        padding: 10px 12px;
    }

    .desk-invoice-timing-label {
        font-size: 13px;
    }
}
@import url('./tokens.css');
@import url('./base.css');
@import url('./layout.css');
@import url('./utilities.css');
@import url('./components/buttons.css');
@import url('./components/forms.css');
@import url('./components/tables.css');
@import url('./components/cards.css');
@import url('./components/badges.css');
@import url('./components/modals.css');
@import url('./components/alerts.css');
@import url('./components/tabs.css');
@import url('./modules/auth.css');
@import url('./modules/dashboard.css');
@import url('./modules/system-health.css');
@import url('./modules/docs.css');
/* Phase 52.1E POS real layout hooks — scoped final override */
.fyn-pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(520px, 34vw, 620px);
    gap: 16px;
    align-items: start;
}

.fyn-pos-product-area {
    min-width: 0;
}

.fyn-pos-side-panel {
    min-width: 0;
    width: 100%;
}

.fyn-pos-side-panel > * {
    width: 100%;
}

.fyn-pos-cart-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.fyn-pos-cart-table-wrap table,
.fyn-pos-cart-table-wrap .pos-cart-table {
    width: 100%;
    min-width: 520px;
}

.fyn-pos-cart-table-wrap th:first-child,
.fyn-pos-cart-table-wrap td:first-child {
    min-width: 180px;
    max-width: 260px;
    white-space: normal;
}

.fyn-pos-cart-table-wrap th:not(:first-child),
.fyn-pos-cart-table-wrap td:not(:first-child) {
    white-space: nowrap;
}

.fyn-pos-cart-table-wrap .pos-qty,
.fyn-pos-cart-table-wrap .qty-control,
.fyn-pos-cart-table-wrap .quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

@media (max-width: 1450px) {
    .fyn-pos-layout {
        grid-template-columns: minmax(0, 1fr) clamp(480px, 32vw, 560px);
    }

    .fyn-pos-cart-table-wrap table,
    .fyn-pos-cart-table-wrap .pos-cart-table {
        min-width: 500px;
    }
}

@media (max-width: 1200px) {
    .fyn-pos-layout {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
    }
}

@media (max-width: 1000px) {
    .fyn-pos-layout {
        grid-template-columns: 1fr;
    }

    .fyn-pos-side-panel {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .fyn-pos-layout {
        gap: 12px;
    }

    .fyn-pos-cart-table-wrap table,
    .fyn-pos-cart-table-wrap .pos-cart-table {
        min-width: 480px;
    }
}
/* Phase 52.1F POS right cards stretch fix */
.fyn-pos-side-panel,
.desk-rightcol {
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-self: stretch;
    align-self: start;
}

.fyn-pos-side-panel .desk-cart,
.fyn-pos-side-panel .desk-note,
.fyn-pos-side-panel .desk-payment,
.fyn-pos-cart-card {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.fyn-pos-side-panel .erp-card,
.desk-rightcol .erp-card {
    width: 100%;
    max-width: none;
}
/* Phase 52.1S POS safe hybrid terminal layout */
.fyn-pos-terminal {
    min-width: 0;
}

.fyn-pos-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(440px, 500px);
    gap: 16px;
    align-items: start;
}

.fyn-pos-product-zone {
    min-width: 0;
}

.fyn-pos-product-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.fyn-pos-order-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 12px;
}

.fyn-pos-order-panel > * {
    width: 100%;
    max-width: none;
}

.fyn-pos-cart-card,
.fyn-pos-note-card,
.fyn-pos-payment-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dbe3ef);
    border-radius: 12px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, .08));
}

.fyn-pos-cart-scroll {
    width: 100%;
    overflow-x: auto;
}

.fyn-pos-cart-scroll table {
    width: 100%;
    min-width: 420px;
}

.fyn-pos-cart-scroll th:first-child,
.fyn-pos-cart-scroll td:first-child {
    white-space: normal;
    min-width: 150px;
    max-width: 220px;
}

.fyn-pos-cart-scroll th:not(:first-child),
.fyn-pos-cart-scroll td:not(:first-child) {
    white-space: nowrap;
}

@media (min-width: 1500px) {
    .fyn-pos-body {
        grid-template-columns: minmax(0, 1fr) minmax(460px, 520px);
    }
}

@media (max-width: 1200px) {
    .fyn-pos-body {
        grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
    }
}

@media (max-width: 1000px) {
    .fyn-pos-body {
        grid-template-columns: 1fr;
    }

    .fyn-pos-order-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .fyn-pos-cart-scroll table {
        min-width: 390px;
    }
}
