/* ==========================================================================
   RICE MILL ERP — THEME v1
   Modern dashboard skin: dark sidebar, colorful data accents.
   Loaded AFTER style.css / interface.css / account.css / dashboard.css /
   notification-response.css / workflow-navigation.css / login.css so these
   rules win the cascade without needing !important. Structural layout
   (grid columns, flex directions, functionality) from the original files
   is left untouched — this file only re-skins color, type, spacing,
   radius and shadow on the shared components used across every page.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* base surfaces */
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-alt: #eef2ef;
  --border: #e1e8e3;
  --text: #16211c;
  --muted: #647368;

  /* brand / structural */
  --brand: #0e3a2c;
  --brand-2: #17805a;
  --green: #17805a;
  --green-dark: #0e3a2c;

  /* colorful accent set — used deliberately per data domain, not randomly */
  --accent: #e3a73a;      /* paddy gold — purchase / grain */
  --accent-teal: #1c9c93;  /* water/steam teal — stock & production */
  --accent-coral: #e2694b; /* warm coral — accounts / attention */
  --accent-violet: #7c6fe0;/* violet — admin / system */
  --accent-blue: #3576e0;  /* blue — sales */

  --success: #17805a;
  --warning: #e3a73a;
  --danger: #cf4436;
  --info: #1c9c93;

  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(15, 35, 25, 0.06);
  --shadow: 0 10px 28px rgba(15, 35, 25, 0.08);
  --shadow-soft: 0 10px 28px rgba(15, 35, 25, 0.08);
  --shadow-lg: 0 22px 48px rgba(15, 35, 25, 0.14);

  --font-body: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: Manrope, Inter, "Segoe UI", system-ui, sans-serif;

  --sidebar-w: 250px;
}

/* ---------------------------------------------------------------------- */
/* Base                                                                    */
/* ---------------------------------------------------------------------- */

html, body {
  font-family: var(--font-body);
}

body {
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand strong, .login-visual h2, .login-form-panel h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

::selection { background: rgba(28, 156, 147, 0.25); }

*:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* thin, quiet scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: #c3cfc8 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c3cfc8; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------------- */
/* App shell                                                               */
/* ---------------------------------------------------------------------- */

.app {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ---------------------------------------------------------------------- */
/* Sidebar                                                                 */
/* ---------------------------------------------------------------------- */

.sidebar {
  background:
    radial-gradient(circle at 10% 0%, rgba(28, 156, 147, 0.16), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(227, 167, 58, 0.10), transparent 46%),
    linear-gradient(190deg, #0b2a20 0%, #0a1f17 62%, #081a13 100%);
  color: #eef4f0;
  padding: 20px 14px 24px;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}

.brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 2px 6px 16px;
  margin-bottom: 12px;
}

.brand strong {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand span {
  color: rgba(238, 244, 240, 0.55);
  font-size: 11.5px;
  line-height: 1.4;
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-dashboard-link {
  display: block;
  color: #eef4f0 !important;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-dashboard-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-dashboard-link.active {
  background: rgba(28, 156, 147, 0.18);
  border-left-color: var(--accent-teal);
  color: #ffffff !important;
}

.nav-group {
  border-radius: var(--radius-sm);
  margin: 1px 0;
}

.nav-group summary {
  color: rgba(238, 244, 240, 0.72);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px 6px;
  cursor: pointer;
  list-style: none;
}

.nav-group summary::-webkit-details-marker { display: none; }

.nav-group > div { display: flex; flex-direction: column; gap: 1px; }

.nav-group a {
  display: block;
  color: #dfe9e3 !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px 8px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  margin: 0 2px;
}

.nav-group a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-group a.active {
  background: rgba(227, 167, 58, 0.16);
  border-left-color: var(--accent);
  color: #ffffff !important;
  font-weight: 700;
}

.sidebar-activity {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  margin: 6px 2px 10px;
}

.sidebar-activity summary {
  color: rgba(238, 244, 240, 0.72);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 9px 12px;
}

.sidebar-activity-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
}

.sidebar-activity-item span b { color: #eef4f0; }
.sidebar-activity-item small { color: rgba(238, 244, 240, 0.5); }

.sidebar-activity-all {
  display: block;
  text-align: center;
  color: var(--accent-teal) !important;
  font-weight: 700;
  font-size: 12px;
  padding: 8px;
}

.gate-sidebar-tools a {
  color: #dfe9e3 !important;
  border-left: 3px solid transparent;
}
.gate-sidebar-tools a.active {
  background: rgba(28, 156, 147, 0.18);
  border-left-color: var(--accent-teal);
  color: #fff !important;
}

/* ---------------------------------------------------------------------- */
/* Topbar                                                                  */
/* ---------------------------------------------------------------------- */

.topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  padding: 12px 24px;
}

.topbar h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
}

.user-panel-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-panel-pill span { font-weight: 700; font-size: 12.5px; color: var(--text); }
.user-panel-pill strong { font-weight: 600; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.request-icon-button, .alert-action-button {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  width: 36px;
  height: 36px;
  position: relative;
  color: var(--text);
}

.request-icon-button em, .alert-action-button em {
  background: var(--accent-coral);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  padding: 1px 5px;
  position: absolute;
  top: -6px;
  right: -6px;
}

.topbar-tally-button {
  background: var(--brand-2) !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
}

.topbar-backup {
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
}
.topbar-backup.is-due { color: var(--danger); }
.topbar-backup.is-done { color: var(--success); }

/* ---------------------------------------------------------------------- */
/* Content / panels / cards                                                */
/* ---------------------------------------------------------------------- */

.content { padding: 22px 26px 40px; }

.section-title h2, .finance-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16.5px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.panel, .finance-card, .tally-pane, .account-tile, .store-tile,
.sales-metric, .cashier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel:hover { box-shadow: var(--shadow-sm); }

.panel.metric, .grid.metrics .panel {
  border-radius: var(--radius);
  border-top: 3px solid var(--accent-teal);
  padding: 16px 18px;
}

.grid.metrics { gap: 14px; }

/* cycle colorful accents across the metric cards in a dashboard row so
   different data domains read distinctly at a glance */
.grid.metrics .panel.metric:nth-child(4n+1) { border-top-color: var(--accent-teal); }
.grid.metrics .panel.metric:nth-child(4n+2) { border-top-color: var(--accent); }
.grid.metrics .panel.metric:nth-child(4n+3) { border-top-color: var(--accent-coral); }
.grid.metrics .panel.metric:nth-child(4n+4) { border-top-color: var(--accent-blue); }

.panel.metric span, .metric span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.panel.metric strong, .metric strong { font-family: var(--font-display); font-size: 21px; font-weight: 800; color: var(--text); }

.amount { font-family: var(--font-display); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.button {
  background: var(--brand-2);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(23, 128, 90, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.button:hover {
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(14, 58, 44, 0.26);
  transform: translateY(-1px);
}

.button:active { transform: translateY(0); }

.button.danger, .danger.button, a.button.danger {
  background: var(--danger);
  box-shadow: 0 6px 16px rgba(207, 68, 54, 0.24);
}
.button.danger:hover { background: #a83426; }

.button.muted, .muted-button, .secondary-button {
  background: var(--surface-alt);
  color: var(--text) !important;
  box-shadow: none;
  border: 1px solid var(--border);
}
.button.muted:hover, .muted-button:hover, .secondary-button:hover {
  background: #e4ebe6;
  transform: none;
}

.mini-button {
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */

.form-grid label, .field {
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
}

.form-grid input, .form-grid select, .form-grid textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
select, textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(28, 156, 147, 0.14);
  outline: none;
}

/* ---------------------------------------------------------------------- */
/* Tables                                                                  */
/* ---------------------------------------------------------------------- */

table, .finance-table, .tally-table {
  border-collapse: separate;
  border-spacing: 0;
}

table thead th, .finance-table thead th, .tally-table thead th {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  position: sticky;
  top: 0;
}

table tbody td, .finance-table tbody td, .tally-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--surface-alt);
  font-size: 13px;
}

table tbody tr:hover td, .finance-table tbody tr:hover td {
  background: var(--surface-soft);
}

.finance-table-wrap, .table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

/* ---------------------------------------------------------------------- */
/* Status pills / chips / badges                                          */
/* ---------------------------------------------------------------------- */

.status-pill, .sales-chip, .store-chip {
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 11.5px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-approved { background: rgba(23, 128, 90, 0.12); color: var(--success); }
.status-pending { background: rgba(227, 167, 58, 0.16); color: #93701f; }
.status-rejected, .status-returned { background: rgba(207, 68, 54, 0.12); color: var(--danger); }

.sales-chip { background: rgba(53, 118, 224, 0.10); color: var(--accent-blue); }
.store-chip { background: rgba(28, 156, 147, 0.12); color: var(--accent-teal); }

/* ---------------------------------------------------------------------- */
/* Drawers / dialogs / modals / toasts                                    */
/* ---------------------------------------------------------------------- */

.request-drawer {
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border);
}

.request-drawer-head, .notification-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.request-drawer-head strong, .notification-header h2 { color: #fff; font-family: var(--font-display); }
.request-drawer-head span, .notification-header span { color: rgba(255, 255, 255, 0.7); }

.notification-item.danger { border-left: 3px solid var(--danger); }
.notification-item.warning { border-left: 3px solid var(--warning); }

.confirm-modal, .document-modal, .bag-scan-dialog {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.confirm-head strong, .document-modal-head strong { font-family: var(--font-display); }

dialog.profile-dialog {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.toast {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* ---------------------------------------------------------------------- */
/* Login page                                                              */
/* ---------------------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.login-visual {
  background:
    radial-gradient(circle at 15% 10%, rgba(227, 167, 58, 0.22), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(28, 156, 147, 0.22), transparent 45%),
    linear-gradient(200deg, #0b2a20, #081a13 75%);
  color: #eef4f0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand-row h1 { color: #fff; font-family: var(--font-display); font-size: 21px; }
.login-brand-row span { color: rgba(238, 244, 240, 0.6); font-size: 12.5px; }

.auth-portal-label {
  display: inline-flex;
  background: rgba(227, 167, 58, 0.18);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-weight: 700;
  font-size: 11.5px;
  margin-bottom: 14px;
}

.auth-brand-story h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  max-width: 460px;
}

.auth-brand-story p { color: rgba(238, 244, 240, 0.68); font-size: 14px; max-width: 420px; }

.auth-brand-footer span {
  color: rgba(238, 244, 240, 0.85);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  margin-right: 8px;
  display: inline-block;
}

.auth-contact { color: rgba(238, 244, 240, 0.6); font-size: 12.5px; }
.auth-contact b { color: #eef4f0; }

.login-form-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form-inner { width: min(380px, 100%); }

.login-kicker {
  color: var(--accent-teal);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.login-form-inner h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}

.login-form-inner p { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }

.login-form-inner form { display: flex; flex-direction: column; gap: 14px; }

.login-form-inner label { font-weight: 600; font-size: 12.5px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }

.login-form-inner input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
}

.login-form-inner button[type="submit"] {
  background: linear-gradient(135deg, var(--brand-2), var(--accent-teal));
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(23, 128, 90, 0.25);
  margin-top: 4px;
}

.login-form-inner button[type="submit"]:hover { filter: brightness(1.05); }

.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.login-links a { color: var(--accent-teal); font-size: 12.5px; font-weight: 600; text-decoration: none; }

.login-protected { color: var(--muted); font-size: 11.5px; margin-top: 22px; text-align: center; }

.auth-message {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  background: rgba(28, 156, 147, 0.1);
  color: var(--info);
}
.auth-message-error { background: rgba(207, 68, 54, 0.1); color: var(--danger); }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { padding: 32px; }
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content { padding: 16px; }
}
