/* =====================================================================
   Printing Unit ERP — Theme
   Palette: Deep Emerald -> Teal gradient, Ivory surface, Mint accent
   Fonts: Poppins (headings), Inter (body)
   ===================================================================== */

:root {
  --emerald-900: #0B4D33;
  --emerald-700: #0E7A4E;
  --teal-500:    #12A46E;
  --mint-400:    #6FE3A6;
  --ivory-50:    #F5FAF7;
  --surface:     #FFFFFF;
  --border:      #E3ECE7;
  --text-900:    #17241D;
  --text-600:    #52625A;
  --text-400:    #8B978F;
  --danger:      #D64545;
  --warning:     #DD9A2B;
  --info:        #2F7FED;
  --success:     #12A46E;

  --gradient-primary: linear-gradient(160deg, var(--emerald-900) 0%, var(--teal-500) 100%);
  --gradient-soft:    linear-gradient(135deg, rgba(18,164,110,0.10) 0%, rgba(111,227,166,0.10) 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 2px 10px rgba(23, 36, 29, 0.06);
  --shadow-elevated: 0 8px 24px rgba(11, 77, 51, 0.14);
  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--ivory-50);
  color: var(--text-900);
  font-size: 14.5px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', sans-serif; color: var(--text-900); margin: 0 0 8px; }

a { color: var(--teal-500); text-decoration: none; }
a:hover { color: var(--emerald-900); }

/* ---------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-primary);
  color: #EAFBF2;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-weight: 700; color: #fff;
}
.sidebar-brand .brand-text { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 16px; color: #fff; }
.sidebar-brand .brand-sub { font-size: 11px; color: rgba(234,251,242,0.65); }

.sidebar-nav { padding: 14px 10px 30px; }
.sidebar-section-label {
  font-size: 11px; letter-spacing: 0.4px; color: rgba(234,251,242,0.55);
  padding: 14px 12px 6px;
}
.sidebar-nav a.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(234,251,242,0.88);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}
.sidebar-nav a.nav-link i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-nav a.nav-link:hover { background: rgba(255,255,255,0.10); color: #fff; }
.sidebar-nav a.nav-link.active { background: rgba(255,255,255,0.18); color: #fff; }

.main-area { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 18px; }
.topbar .topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar .menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text-900); cursor: pointer; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px;
}
.user-chip .u-name { font-weight: 600; font-size: 13.5px; }
.user-chip .u-role { font-size: 11.5px; color: var(--text-400); }

.content-area { padding: 26px; flex: 1; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 22px;
}
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-header-row h3 { font-size: 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); padding: 20px; display: flex; align-items: center; gap: 16px;
}
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
  background: var(--gradient-primary); flex-shrink: 0;
}
.kpi-icon.warn { background: linear-gradient(160deg, #DD9A2B, #F2C265); }
.kpi-icon.danger { background: linear-gradient(160deg, #B23A3A, #E06868); }
.kpi-icon.info { background: linear-gradient(160deg, #1E5FC9, #4C9AF2); }
.kpi-value { font-family: 'Poppins', sans-serif; font-size: 22px; font-weight: 700; }
.kpi-label { font-size: 12.5px; color: var(--text-600); }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; padding: 9px 18px; border: none; cursor: pointer; }
.btn-primary { background: var(--gradient-primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-900); }
.btn-outline:hover { border-color: var(--teal-500); color: var(--teal-500); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-600); margin-bottom: 5px; display: block; }
.form-control, .form-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; width: 100%; background: #fff; color: var(--text-900);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(18,164,110,0.14);
}
.form-section-title {
  font-family: 'Poppins', sans-serif; font-size: 13.5px; font-weight: 600;
  color: var(--emerald-900); text-transform: none;
  border-left: 3px solid var(--teal-500); padding-left: 10px; margin: 22px 0 14px;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.erp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.erp-table thead th {
  background: var(--gradient-soft); color: var(--emerald-900);
  text-align: left; padding: 11px 14px; font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.erp-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
table.erp-table tbody tr:hover { background: #FAFDFB; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-success { background: rgba(18,164,110,0.12); color: var(--success); }
.badge-warning { background: rgba(221,154,43,0.14); color: var(--warning); }
.badge-danger  { background: rgba(214,69,69,0.12); color: var(--danger); }
.badge-muted   { background: #EEF2F0; color: var(--text-600); }
.text-right { text-align: right; }

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-primary); padding: 20px;
}
.login-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated);
  width: 100%; max-width: 380px; padding: 38px 32px;
}
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .logo-mark {
  width: 56px; height: 56px; border-radius: 14px; background: var(--gradient-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px;
}
.login-card h2 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.login-card p.subtitle { text-align: center; color: var(--text-600); font-size: 13px; margin-bottom: 24px; }
.login-card .btn-primary { width: 100%; padding: 11px; margin-top: 8px; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-danger { background: rgba(214,69,69,0.10); color: var(--danger); }
.alert-success { background: rgba(18,164,110,0.10); color: var(--success); }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-elevated); }
  .main-area { margin-left: 0; }
  .topbar .menu-toggle { display: block; }
}
