/* ==========================================================================
   نظام إدارة المطبعة — Design System
   Premium Dark Theme · RTL Arabic · Glassmorphism
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette — Deep Navy with Cyan/Emerald accents */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a1f35;
    --bg-card-hover: #1f2544;
    --bg-input: #151a2e;
    --bg-sidebar: #0d1221;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    --border-color-focus: #3b82f6;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #e2e8f0;

    --accent-primary: #3b82f6;     /* Blue */
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981;     /* Emerald */
    --accent-warning: #f59e0b;     /* Amber */
    --accent-danger: #ef4444;      /* Red */
    --accent-info: #06b6d4;        /* Cyan */
    --accent-purple: #8b5cf6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 75, 0.5) 0%, rgba(20, 27, 55, 0.8) 100%);

    /* Glass */
    --glass-bg: rgba(26, 31, 53, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);

    /* Typography */
    --font-arabic: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    --font-numbers: 'Inter', 'Cairo', sans-serif;

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic numerals override — use Inter for digits & currency */
.num,
.currency,
input[type="number"],
input[type="date"],
td:has(.num),
.kpi-value,
.balance-amount {
    font-family: var(--font-numbers);
    direction: ltr;
    unicode-bidi: embed;
}

/* --------------------------------------------------------------------------
   Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-smooth);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: var(--radius-md);
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: #fff;
}

.nav-item.active::before {
    opacity: 0.15;
}

.nav-item.active i {
    color: var(--accent-primary);
}

.nav-item i {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.nav-item span {
    position: relative;
    z-index: 1;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 8px;
}

.nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 16px 8px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   MAIN CONTENT
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    flex: 1;
}

.currency-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.page-content {
    flex: 1;
    padding: 28px 32px;
}

/* --------------------------------------------------------------------------
   LOADING STATE
   -------------------------------------------------------------------------- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
}

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

/* --------------------------------------------------------------------------
   KPI CARDS (Dashboard)
   -------------------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    position: relative;
    background: var(--gradient-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.kpi-card.blue::before   { background: var(--gradient-primary); }
.kpi-card.green::before  { background: var(--gradient-success); }
.kpi-card.amber::before  { background: linear-gradient(180deg, #f59e0b, #d97706); }
.kpi-card.red::before    { background: var(--gradient-danger); }
.kpi-card.purple::before { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.kpi-card.cyan::before   { background: linear-gradient(180deg, #06b6d4, #0891b2); }

.kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    opacity: 0.15;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   CARDS & PANELS
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.card:hover {
    border-color: var(--border-color-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2,
.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
}

.card-body {
    padding: 24px;
}

/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   FORMS
   -------------------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

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

input[type="number"] {
    font-family: var(--font-numbers);
    text-align: left;
    direction: ltr;
}

input[type="date"] {
    font-family: var(--font-numbers);
}

/* Number input — remove spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* --------------------------------------------------------------------------
   FORM SECTIONS
   -------------------------------------------------------------------------- */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-heading);
}

.form-section-header i {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.form-section-body {
    padding: 20px 24px;
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: var(--shadow-glow-green);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}
.btn-danger:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm i {
    width: 14px;
    height: 14px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   STATUS BADGES
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-new       { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-progress  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-done      { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-delivered { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* --------------------------------------------------------------------------
   COST SUMMARY SIDEBAR
   -------------------------------------------------------------------------- */
.cost-summary {
    background: var(--gradient-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: calc(var(--header-height) + 28px);
}

.cost-summary h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.cost-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.88rem;
}

.cost-line .label {
    color: var(--text-secondary);
}

.cost-line .value {
    font-family: var(--font-numbers);
    font-weight: 600;
    color: var(--text-primary);
}

.cost-line.total {
    border-top: 2px solid var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1rem;
}

.cost-line.total .label {
    color: var(--text-heading);
    font-weight: 700;
}

.cost-line.total .value {
    font-weight: 800;
    font-size: 1.1rem;
}

.cost-line.profit .value.positive { color: var(--accent-success); }
.cost-line.profit .value.negative { color: var(--accent-danger); }

/* --------------------------------------------------------------------------
   ORDER FORM LAYOUT
   -------------------------------------------------------------------------- */
.order-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

/* --------------------------------------------------------------------------
   BALANCE CARDS (Suppliers / Clients)
   -------------------------------------------------------------------------- */
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.entity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.entity-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.entity-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.entity-card-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.entity-card-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.balance-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 1.2rem;
    font-weight: 800;
}

.balance-amount.positive { color: var(--accent-danger); }
.balance-amount.zero     { color: var(--accent-success); }
.balance-amount.negative { color: var(--accent-success); }

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease forwards;
    border-right: 4px solid;
}

.toast.success { border-right-color: var(--accent-success); }
.toast.error   { border-right-color: var(--accent-danger); }
.toast.warning { border-right-color: var(--accent-warning); }
.toast.info    { border-right-color: var(--accent-info); }

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

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

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

/* --------------------------------------------------------------------------
   MODAL
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade-in 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modal-in 0.25s ease;
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 24px;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* --------------------------------------------------------------------------
   EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   SEARCH & FILTERS
   -------------------------------------------------------------------------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input input {
    width: 100%;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 40px 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input input:focus {
    border-color: var(--border-color-focus);
}

.search-input i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */
.text-success { color: var(--accent-success) !important; }
.text-danger  { color: var(--accent-danger) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-muted   { color: var(--text-muted) !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */
@media print {
    .sidebar,
    .top-bar,
    .toast-container,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .order-form-layout {
        grid-template-columns: 1fr;
    }

    .cost-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .top-bar {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .entity-grid {
        grid-template-columns: 1fr;
    }
}
