/* ============================================================
 * FILE:  assets/css/atelier.css — Atelier Design System
 * MODULE: Design System — Premium calm craft-inspired tokens
 * ============================================================ */

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --primary: #4F46E5; --primary-600: #4338CA; --primary-050: #EEF0FF;
  --accent: #C79A3A; --ink: #0F172A; --body: #334155; --muted: #64748B;
  --line: #E2E8F0; --bg: #F7F8FB; --surface: #FFFFFF;
  --success: #16A34A; --warning: #D97706; --danger: #DC2626; --info: #0EA5E9;
  --st-booked: #94A3B8; --st-cutting: #F59E0B; --st-stitching: #6366F1;
  --st-finishing: #8B5CF6; --st-ready: #10B981; --st-trial: #0EA5E9; --st-delivered: #22C55E;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(15,23,42,.06); --shadow-lg: 0 12px 30px rgba(15,23,42,.10);
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-arabic: 'Tajawal', sans-serif;
}

/* ─── Typography ──────────────────────────────────────────── */
body { font-family: var(--font-body); color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); color: var(--ink); font-weight: 600; }
[dir=rtl] body { font-family: var(--font-arabic), var(--font-body); }

/* ─── Layout ──────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-main { flex: 1; margin-left: 260px; transition: margin-left .3s; min-height: 100vh; background: var(--bg); }
@media (max-width: 991px) { .app-main { margin-left: 0; } }

/* ─── Navbar ──────────────────────────────────────────────── */
.app-navbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 100;
}
.navbar-left { display: flex; align-items: center; gap: 16px; }
.navbar-right { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: none; background: transparent; color: var(--body);
  border-radius: var(--radius-sm); cursor: pointer; font-size: .9rem; transition: background .2s;
}
.nav-btn:hover { background: var(--bg); }
.navbar-toggler {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--body); font-size: 1.25rem; border-radius: var(--radius-sm); cursor: pointer;
}
.navbar-toggler:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-050); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-btn { gap: 8px; }

/* Search */
.navbar-search { position: relative; }
.navbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px; font-size: .85rem;
  width: 240px; background: var(--bg); transition: all .2s;
}
.search-input:focus { outline: none; border-color: var(--primary); width: 300px; background: var(--surface); }

.notification-badge {
  position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff;
  font-size: .65rem; border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.notification-dropdown { width: 320px; max-height: 400px; overflow-y: auto; }
.lang-toggle { font-weight: 700; font-size: .95rem; min-width: 40px; text-align: center; text-decoration: none; color: var(--body); }
.lang-toggle:hover { color: var(--primary); }

/* ─── Sidebar ─────────────────────────────────────────────── */
.app-sidebar {
  width: 260px; background: var(--surface); border-right: 1px solid var(--line);
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 200;
  display: flex; flex-direction: column; transition: transform .3s;
}
[dir=rtl] .app-sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--line); }
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.sidebar-brand i { font-size: 1.5rem; color: var(--primary); }
.sidebar-toggle { background: none; border: none; font-size: 1.25rem; color: var(--body); cursor: pointer; padding: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-item { margin: 2px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--body); text-decoration: none;
  font-size: .875rem; font-weight: 500; transition: all .2s;
}
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-link.active { background: var(--primary-050); color: var(--primary); font-weight: 600; }
.nav-link i { font-size: 1.15rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--line); margin: 8px 14px; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--line); }
.sidebar-version { font-size: .75rem; color: var(--muted); }

/* Sidebar mobile */
@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  [dir=rtl] .app-sidebar { transform: translateX(100%); }
  .app-sidebar.open { transform: translateX(0); }
  [dir=rtl] .app-sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 199; }
  .sidebar-overlay.show { display: block; }
}

/* ─── Cards ───────────────────────────────────────────────── */
.card, .dashboard-card { background: var(--surface); border: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 16px 20px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 20px; }
.page-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }

/* ─── Stat Cards ──────────────────────────────────────────── */
.stat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-label { font-size: .75rem; color: var(--muted); }

/* ─── Page Header ─────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--muted); font-size: .875rem; }

/* ─── Tables ──────────────────────────────────────────────── */
.table { margin: 0; }
.table thead th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table-hover tbody tr:hover { background: var(--bg); }

/* ─── Forms — Atelier Style ───────────────────────────────── */
.atelier-form .form-label { font-weight: 600; font-size: .85rem; color: var(--ink); margin-bottom: 6px; }
.atelier-form .form-control,
.atelier-form .form-select { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; transition: border-color .2s, box-shadow .2s; }
.atelier-form .form-control:focus,
.atelier-form .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); outline: none; }
.atelier-form .input-group-text { background: var(--bg); border: 1.5px solid var(--line); color: var(--muted); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn { border-radius: var(--radius-sm); padding: 10px 20px; font-weight: 600; font-size: .875rem; transition: all .2s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-ghost { background: transparent; border: none; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--body); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 16px 0; border-top: 1px solid var(--line); margin-top: 24px; }

/* ─── Badges ──────────────────────────────────────────────── */
.badge { font-weight: 500; font-size: .75rem; padding: 4px 10px; border-radius: 20px; }

/* ─── Alerts ──────────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; }

/* ─── Error Pages ─────────────────────────────────────────── */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ─── Dropdowns ───────────────────────────────────────────── */
.dropdown-menu { border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 6px; padding: 8px 12px; font-size: .875rem; display: flex; align-items: center; gap: 8px; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.active { background: var(--primary-050); color: var(--primary); }
.dropdown-header { padding: 8px 12px; }
.dropdown-divider { margin: 4px 0; }
.dropdown-user-info { white-space: nowrap; }

/* ─── Progress Bars ───────────────────────────────────────── */
.progress { background: var(--bg); border-radius: 20px; overflow: hidden; }
.progress-bar { border-radius: 20px; transition: width .3s; }

/* ─── Kanban Board ────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column { min-width: 260px; background: var(--bg); border-radius: var(--radius); padding: 12px; }
.kanban-header { font-weight: 600; font-size: .85rem; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.kanban-card { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px; margin-bottom: 8px; cursor: grab; }

/* ─── Utilities & Animations ──────────────────────────────── */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.inline-code { font-family: 'JetBrains Mono', monospace; }

/* ─── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 576px) {
  .stat-card { padding: 12px; } .stat-value { font-size: 1rem; } .page-title { font-size: 1.25rem; }
  .search-input { width: 160px; } .search-input:focus { width: 200px; }
}
