/* Pallet ERP — minimal, clean, ERP-ish look */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #f3f4f6;
    line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.topbar {
    background: #1e293b;
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.brand a {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 16px 0;
    display: inline-block;
}
.main-nav { display: flex; gap: 4px; }
.main-nav a {
    color: #cbd5e1;
    padding: 18px 16px;
    display: inline-block;
    border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: #fff; text-decoration: none; }
.main-nav a.active {
    color: #fff;
    border-bottom-color: #3b82f6;
    background: rgba(255,255,255,.05);
}
.lang-switcher { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.lang-switcher a { color: #94a3b8; padding: 4px 6px; border-radius: 4px; }
.lang-switcher a:hover { color: #fff; text-decoration: none; }
.lang-switcher a.lang-active { color: #fff; background: rgba(255,255,255,.15); font-weight: 600; }
.lang-switcher span { color: #475569; }

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-header h1 {
    margin: 0;
    font-size: 22px;
    color: #0f172a;
}
.subtitle { color: #64748b; font-size: 13px; margin-top: 4px; }

/* Cards & panels */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}
.card-header h2 {
    font-size: 16px;
    margin: 0;
    color: #0f172a;
}

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Stat tile */
.stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}
.stat .label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.stat .value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
}
.stat .sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.stat.alert { border-left: 4px solid #ef4444; }
.stat.warn { border-left: 4px solid #f59e0b; }
.stat.ok { border-left: 4px solid #10b981; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
table th, table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}
table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: .3px;
}
table tr:hover td { background: #f9fafb; }
table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
.form-row { margin-bottom: 14px; }
.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-row .help { font-size: 12px; color: #6b7280; margin-top: 4px; }

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }
.btn-success { background: #16a34a; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-draft              { background: #f1f5f9; color: #475569; }
.badge-confirmed          { background: #dbeafe; color: #1e40af; }
.badge-in_production, .badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-partial_production { background: #ffedd5; color: #9a3412; }
.badge-planned            { background: #f1f5f9; color: #475569; }
.badge-pending_approval   { background: #fde8ff; color: #7e22ce; }
.badge-partial            { background: #ffedd5; color: #9a3412; }
.badge-completed          { background: #dcfce7; color: #166534; }
.badge-closed             { background: #e5e7eb; color: #374151; }
.badge-shipped            { background: #ccfbf1; color: #115e59; }
.badge-invoiced           { background: #dcfce7; color: #166534; }
.badge-done               { background: #1e293b; color: #fff; }
.badge-sent               { background: #dcfce7; color: #166534; }
.badge-active             { background: #dcfce7; color: #166534; }

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-warn    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 12px;
}

/* Misc */
.actions { display: flex; gap: 6px; }
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}
.module-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.module-tile {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 14px;
    color: #1f2937;
    display: block;
}
.module-tile:hover { background: #fff; border-color: #3b82f6; text-decoration: none; }
.module-tile .tile-title { font-weight: 600; }
.module-tile .tile-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }

.section-divider {
    margin: 24px 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
}
