/* PrintManager Pro — App Styles */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --teal:     #1D9E75; --teal-d: #085041; --teal-l: #E1F5EE;
  --purple:   #7F77DD; --purple-d: #3C3489; --purple-l: #EEEDFE;
  --amber:    #BA7517; --amber-l: #FAEEDA;
  --red:      #A32D2D; --red-l:   #FCEBEB;
  --blue:     #185FA5; --blue-l:  #E6F1FB;
  --green:    #3B6D11; --green-l: #EAF3DE;
  --gray:     #5F5E5A; --gray-l:  #F1EFE8; --gray-d: #2C2C2A;
  --text:     #1a1a18; --muted:   #888780;
  --border:   #D3D1C7; --white:   #ffffff;
  --sidebar-w: 230px;
  --topbar-h:  56px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
       background: var(--gray-l); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
           background: var(--teal-d); display: flex; flex-direction: column;
           z-index: 100; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 10px;
                padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo-icon { width: 34px; height: 34px; background: var(--teal);
                     border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo-text { color: white; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
            color: rgba(255,255,255,.7); text-decoration: none; font-size: 13.5px; transition: all .15s; }
.nav-link svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.08); color: white; }
.nav-link.active { background: var(--teal); color: white; }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 8px 4px; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.1);
                  display: flex; align-items: center; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 8px; flex: 1; padding: 6px 8px;
             border-radius: 8px; text-decoration: none; transition: background .15s; min-width: 0; }
.user-chip:hover { background: rgba(255,255,255,.08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal);
          display: flex; align-items: center; justify-content: center;
          font-size: 13px; font-weight: 600; color: white; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 500; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.5); text-transform: capitalize; }
.logout-btn { display: flex; align-items: center; justify-content: center;
              width: 32px; height: 32px; border-radius: 6px; color: rgba(255,255,255,.5);
              text-decoration: none; transition: all .15s; flex-shrink: 0; }
.logout-btn:hover { background: rgba(255,255,255,.08); color: white; }

/* ── Main layout ──────────────────────────────────────────────────────────── */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); background: var(--white); border-bottom: 1px solid var(--border);
          display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); }
.page-title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.content { padding: 24px; flex: 1; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px;
       border-radius: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer;
       border: 1.5px solid transparent; text-decoration: none; transition: all .15s; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary   { background: var(--teal); color: white; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--gray); }
.btn-danger    { background: var(--red-l); color: var(--red); border-color: #F7C1C1; }
.btn-danger:hover { background: #F7C1C1; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card { background: var(--white); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border);
               display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ── Stats grid ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: 10px; border: 1px solid var(--border);
             padding: 16px 18px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--text); }
.stat-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-card.accent-teal   .stat-value { color: var(--teal-d); }
.stat-card.accent-amber  .stat-value { color: var(--amber); }
.stat-card.accent-red    .stat-value { color: var(--red); }
.stat-card.accent-purple .stat-value { color: var(--purple-d); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600;
     color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
     border-bottom: 1px solid var(--border); white-space: nowrap; background: #FAFAF8; }
td { padding: 12px 14px; border-bottom: 1px solid #F1EFE8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAF8; }
.td-actions { display: flex; gap: 6px; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
         font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge-teal   { background: var(--teal-l);   color: var(--teal-d); }
.badge-amber  { background: var(--amber-l);  color: var(--amber); }
.badge-blue   { background: var(--blue-l);   color: var(--blue); }
.badge-purple { background: var(--purple-l); color: var(--purple-d); }
.badge-green  { background: var(--green-l);  color: var(--green); }
.badge-red    { background: var(--red-l);    color: var(--red); }
.badge-gray   { background: var(--gray-l);   color: var(--gray); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text); }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 14px; color: var(--text); background: var(--white); outline: none;
  transition: border-color .15s; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); }
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field-error input, .field-error select { border-color: var(--red); }
.field-error .error-msg { font-size: 11.5px; color: var(--red); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px;
         display: flex; align-items: flex-start; gap: 10px; }
.alert button { margin-left: auto; background: none; border: none; font-size: 18px;
                cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }
.alert-success { background: var(--teal-l);  color: var(--teal-d);  border: 1px solid #9FE1CB; }
.alert-error   { background: var(--red-l);   color: var(--red);     border: 1px solid #F7C1C1; }
.alert-warning { background: var(--amber-l); color: var(--amber);   border: 1px solid #FAC775; }
.alert-info    { background: var(--blue-l);  color: var(--blue);    border: 1px solid #B5D4F4; }

/* ── Kanban ───────────────────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kanban-col { background: var(--gray-l); border-radius: 10px; padding: 12px; min-height: 200px; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between;
                     margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.kanban-col-title { font-size: 13px; font-weight: 600; }
.kanban-count { background: var(--white); border: 1px solid var(--border);
                border-radius: 20px; padding: 1px 8px; font-size: 11px; color: var(--muted); }
.kanban-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px;
               padding: 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow .15s; }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.kanban-card-order { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.kanban-card-name  { font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.kanban-card-meta  { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px 20px; border-top: 1px solid var(--border); }
.page-link { display: inline-flex; align-items: center; justify-content: center;
             width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
             font-size: 13px; text-decoration: none; color: var(--text); transition: all .15s; }
.page-link:hover { background: var(--gray-l); }
.page-link.active { background: var(--teal); color: white; border-color: var(--teal); }
.page-info { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state svg { width: 48px; height: 48px; fill: var(--border); margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.empty-state p  { font-size: 14px; color: var(--muted); margin-bottom: 16px; }

/* ── Search / filter bar ──────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 7px 11px; border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 13.5px; outline: none; background: var(--white); color: var(--text); }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--teal); }
.filter-bar input[type="search"] { min-width: 200px; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
}
