/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Enterprise Supply Chain & Logistics theme */
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #1e3a5f;
  --navy-600: #2563eb;
  --teal: #0d9488;
  --teal-light: #14b8a6;
  --green: #059669;
  --green-light: #10b981;
  --orange: #ea580c;
  --orange-light: #f97316;
  --white: #ffffff;
  --grey-50: #f8fafc;
  --grey-100: #f1f5f9;
  --grey-200: #e2e8f0;
  --grey-400: #94a3b8;
  --grey-600: #475569;
  --grey-800: #334155;
  --red: #dc2626;
  --red-hover: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  /* Legacy var names for compatibility */
  --bg-dark: var(--navy-800);
  --card-bg: var(--white);
  --nav-active: var(--navy-700);
  --text: var(--navy-900);
  --text-muted: var(--grey-600);
  --input-bg: var(--white);
  --input-text: var(--navy-900);
  --border: var(--grey-200);
  --primary: var(--navy-700);
  --primary-hover: var(--navy-900);
  --btn-start: var(--green);
  --btn-start-hover: var(--green-light);
  --btn-end: var(--red);
  --btn-end-hover: var(--red-hover);
  --success: var(--green);
  --shadow: var(--shadow-md);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  background: #1a1726;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* Login overlay – frosted glass, supply chain theme */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(160deg, #1a1726 0%, #252238 40%, #1e2a3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-overlay.hidden {
  display: none;
}

/* Abstract supply chain background – bars and dotted lines */
.login-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 18%, rgba(255,255,255,0.04) 18%, rgba(255,255,255,0.04) 22%, transparent 22%),
    linear-gradient(90deg, transparent 72%, rgba(255,255,255,0.05) 72%, rgba(255,255,255,0.05) 76%, transparent 76%),
    radial-gradient(circle 1.5px at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 100%);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  background-position: 0 0, 0 0, 0 0;
  pointer-events: none;
}

.login-overlay::after {
  content: '';
  position: absolute;
  bottom: 12%;
  left: 10%;
  width: 45px;
  height: 90px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  pointer-events: none;
}

.login-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-bg-shapes::before {
  content: '';
  position: absolute;
  bottom: 18%;
  right: 12%;
  width: 55px;
  height: 110px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}

.login-bg-shapes::after {
  content: '';
  position: absolute;
  bottom: 25%;
  left: 18%;
  width: 35px;
  height: 70px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}

/* Frosted glass card */
.login-card {
  position: relative;
  z-index: 1;
  background: rgba(37, 34, 54, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.08);
  padding: 1.5rem 1.75rem;
  width: 100%;
  max-width: 400px;
  transition: box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card:hover {
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.12);
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.login-icon {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto 0.75rem;
  display: block;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
}

.login-form .form-row {
  margin-bottom: 0.75rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(26, 23, 38, 0.8);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.login-form input:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
}

.login-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #4f46e5;
  cursor: pointer;
}

.login-forgot {
  font-size: 1rem;
  color: rgba(79, 70, 229, 0.95);
  text-decoration: none;
  font-weight: 500;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-form .btn-login {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(79, 70, 229, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.login-form .btn-login:hover {
  background: rgba(99, 90, 249, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.login-form .btn-login:active {
  transform: scale(0.99);
}

.login-error {
  font-size: 0.875rem;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.app-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Header – dark navy gradient */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #1a1726 0%, #252238 50%, #1e2a3a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
}

.top-header .logo-icon {
  width: 1.35rem;
  height: 1.35rem;
  color: rgba(255, 255, 255, 0.95);
  flex-shrink: 0;
}

.top-header .logo-img {
  height: 3.25rem;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  text-align: center;
  padding: 0 0.75rem;
}

.app-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.header-right {
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-user-info {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.header-user-icon {
  opacity: 0.9;
}

.btn-logout {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(45, 42, 62, 0.9);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-logout:hover {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.sidebar-toggle {
  display: none;
}

.sidebar-overlay {
  display: none;
}

/* Role-based access: Supervisor view-only (hide Edit/Delete and Add forms) */
body.role-supervisor .btn-edit,
body.role-supervisor .btn-delete-customer,
body.role-supervisor .delete-btn,
body.role-supervisor .monitor-delete,
body.role-supervisor .btn-edit-user,
body.role-supervisor .btn-delete-user {
  display: none !important;
}

body.role-supervisor #storage-add-movement-card {
  display: none !important;
}

/* Layout: Sidebar + Main */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar – dark vertical gradient */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1a1726 0%, #252238 40%, #2a2640 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 0 1rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.9rem 0.15rem;
  margin-bottom: 0;
}

.sidebar-logo-img {
  height: 2.25rem;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  border-left: 4px solid transparent;
  margin: 0 0.4rem 0.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-left-color: #4f46e5;
}

.nav-icon {
  font-size: 1.15rem;
  width: 1.5em;
  text-align: center;
  opacity: 0.95;
}

.nav-text {
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Main Content – dark gradient */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  position: relative;
  background: linear-gradient(180deg, #1a1726 0%, #252238 30%, #2a2640 100%);
}

.main-content .page {
  position: relative;
  z-index: 1;
}

.main-content::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(ellipse 60% 40% at 80% 10%, rgba(79, 70, 229, 0.06), transparent);
  background-size: 100% 100%;
  background-position: 0 0;
}

.page {
  display: none;
  width: 100%;
  max-width: 100%;
}

.page.active {
  display: block;
}

.page-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.page-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Content Card – dark theme */
.content-card {
  width: 100%;
  min-height: 0;
  background: rgba(37, 34, 54, 0.85);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.2s ease;
}

.content-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.5rem;
}

.placeholder-card {
  color: rgba(255, 255, 255, 0.65);
}

.card-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

.required {
  color: var(--red);
}

/* Form */
.form-row {
  margin-bottom: 0.6rem;
}

.form-row label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.form-grid .form-row {
  margin-bottom: 0;
}

.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem 0.85rem;
}

.form-grid-4 .form-row {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .form-grid,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(26, 23, 38, 0.8);
  color: rgba(255, 255, 255, 0.95);
  min-height: 38px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

select option {
  background: #252238;
  color: rgba(255, 255, 255, 0.95);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.75;
}

/* Activity in progress warning */
.activity-in-progress-warning {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  font-weight: 500;
}
.in-progress-activities-list {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.in-progress-activities-list h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
}
.in-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}
.in-progress-item:last-child { border-bottom: none; }
.in-progress-item .info { flex: 1; min-width: 150px; }
.in-progress-item .info .customer { font-weight: 500; }
.in-progress-item .info .meta { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.in-progress-item .elapsed { font-family: monospace; font-size: 0.9rem; }
.in-progress-actions { display: flex; gap: 0.35rem; align-items: center; flex-shrink: 0; }
.in-progress-item .btn-end-row,
.in-progress-item .btn-pause-row,
.in-progress-item .btn-resume-row { flex-shrink: 0; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.in-progress-item .btn-pause-row { background: #d97706; color: white; }
.in-progress-item .btn-pause-row:hover { background: #f59e0b; }
.in-progress-item .btn-resume-row { background: #059669; color: white; }
.in-progress-item .btn-resume-row:hover { background: #10b981; }
.modal-desc { margin-bottom: 1rem; font-size: 0.9rem; color: rgba(255,255,255,0.8); }

.activity-started-at {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 0.4rem;
}

/* Activity status row */
.activity-status-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.status-label {
  font-weight: 500;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

.status-label.in-progress-tag {
  background: var(--green);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
}

.timer {
  font-family: ui-monospace, monospace;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
}

.activity-buttons {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
}

.btn-start {
  background: var(--green);
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-start:hover {
  background: var(--green-light);
}

.btn-start:active {
  transform: scale(0.98);
}

.btn-end {
  background: var(--red);
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-end:hover {
  background: var(--red-hover);
}

.btn-end:active {
  transform: scale(0.98);
}

.btn-end:hover {
  background: var(--btn-end-hover);
}

.btn-pause {
  background: #d97706;
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-pause:hover {
  background: #f59e0b;
}

.btn-resume {
  background: #059669;
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-resume:hover {
  background: #10b981;
}

.btn-save-activity {
  margin-top: 1.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  min-height: 44px;
}

/* Buttons */
.btn {
  padding: 0.45rem 0.9rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  min-height: 38px;
}

@media (pointer: coarse) {
  .btn {
    min-height: 44px;
    padding: 0.55rem 1rem;
  }
  .nav-item {
    min-height: 44px;
    padding: 0.75rem 0.9rem;
  }
  input[type="text"],
  input[type="date"],
  input[type="month"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    min-height: 44px;
  }
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--navy-700);
  color: white;
}

.btn-primary:hover {
  background: var(--navy-900);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(79, 70, 229, 0.6);
  color: var(--white);
}

.hidden {
  display: none !important;
}

/* Master Data Management */
.master-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.65rem;
}

.master-tab {
  padding: 0.45rem 0.85rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.master-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.master-tab.active {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.master-panel {
  display: none;
}

.master-panel.active {
  display: block;
}

/* Report section tabs */
.report-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.report-tab {
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}

.report-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.report-tab.active {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.report-panel {
  display: none;
}

.report-panel.active {
  display: block;
}

.report-panel .content-card {
  margin-bottom: 0.75rem;
}

.master-panel .content-card {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
  min-height: 0;
}

.master-panel .card-title {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.master-panel .card-hint {
  margin-bottom: 0.35rem;
}

#customer-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

#customer-form input {
  flex: 1;
  min-width: 200px;
}

.btn-add-customer {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
}

.btn-add-customer:hover {
  background: rgba(79, 70, 229, 0.6);
  border-color: rgba(79, 70, 229, 0.5);
}

.bulk-upload-buttons {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.file-input-hidden {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

.btn-import-excel {
  background: var(--btn-start);
  color: white;
  padding: 0.65rem 1.25rem;
  font-family: var(--font);
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-import-excel:hover {
  background: var(--btn-start-hover);
}

.btn-download-template {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
}

.btn-download-template:hover {
  background: rgba(79, 70, 229, 0.6);
  border-color: rgba(79, 70, 229, 0.5);
}

.master-table {
  width: 100%;
  border-collapse: collapse;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.master-table th,
.master-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.master-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(26, 23, 38, 0.8);
}

.master-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.06);
}

.master-table tbody tr:nth-child(odd) {
  background: transparent;
}

.master-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.master-table .btn-edit {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: var(--navy-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 0.4rem;
  transition: background 0.2s ease;
}

.master-table .btn-edit:hover {
  background: var(--navy-900);
}

.master-table .btn-delete-customer {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.master-table .btn-delete-customer:hover {
  background: var(--red-hover);
}

.handling-table .handling-actions {
  white-space: nowrap;
}

.handling-table .btn-edit,
.handling-table .btn-delete-customer {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 0.35rem;
  transition: background 0.2s ease;
}

.handling-table .btn-edit {
  background: var(--navy-700);
  color: var(--white);
}

.handling-table .btn-edit:hover {
  background: var(--navy-900);
}

.handling-table .btn-delete-customer {
  background: var(--red);
  color: var(--white);
}

.handling-table .btn-delete-customer:hover {
  background: var(--red-hover);
}

.master-table .name-cell {
  min-width: 180px;
}

.master-table .edit-sm-input,
.master-table .edit-sm-select {
  width: 100%;
  min-width: 0;
  padding: 0.4rem;
  font-size: 0.9rem;
}

.unitvalue-form-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.unitvalue-form-row select,
.unitvalue-form-row input {
  flex: 1;
  min-width: 140px;
}

#unitvalue-master-form .btn-add-customer {
  margin-top: 0.25rem;
}

.activity-master-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.activity-master-row input,
.activity-master-row select {
  min-width: 140px;
  flex: 1;
}

.end-modal-storage-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.storage-rate-row,
.storage-entry-row,
.vas-charge-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.vas-charge-row input,
.vas-charge-row select {
  min-width: 120px;
  flex: 1;
}


.storage-rate-row select,
.storage-rate-row input[type="number"],
.storage-entry-row select,
.storage-entry-row input {
  min-width: 120px;
  flex: 1;
}

.storage-entry-row input#storage-entry-ref {
  min-width: 140px;
}

.storage-entry-row input#storage-entry-cbm,
.storage-entry-row input#storage-entry-days {
  max-width: 100px;
}

.storage-entry-row input#storage-entry-charge {
  max-width: 120px;
}

.handling-activity-form .form-row {
  margin-bottom: 0.75rem;
}

.handling-activity-form .form-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.handling-charge-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  align-items: center;
  max-width: 420px;
}

.handling-charge-grid label {
  font-size: 0.9rem;
  font-weight: normal;
}

.handling-charge-grid input {
  min-width: 80px;
  max-width: 120px;
}

.handling-activities-table th,
.handling-activities-table td {
  white-space: nowrap;
}

/* Filter row */
.filter-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-row input {
  flex: 1;
  min-width: 120px;
}

/* Operations Monitor filters */
.monitor-filters-card .card-title {
  margin-bottom: 0.4rem;
}

.monitor-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.4rem 0.75rem;
  align-items: end;
}

.monitor-filter-grid .form-row {
  margin-bottom: 0;
}

.monitor-filter-grid .form-row label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.monitor-filter-grid select {
  white-space: nowrap;
  min-width: 120px;
}

.monitor-filter-grid .filter-actions {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}

.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  table-layout: auto;
}

.monitor-table th:nth-child(1),
.monitor-table td:nth-child(1) { min-width: 110px; }
.monitor-table th:nth-child(2),
.monitor-table td:nth-child(2) { min-width: 140px; }
.monitor-table th:nth-child(3),
.monitor-table td:nth-child(3) { min-width: 90px; }
.monitor-table th:nth-child(4),
.monitor-table td:nth-child(4) { min-width: 100px; }
.monitor-table th:nth-child(5),
.monitor-table td:nth-child(5) { min-width: 100px; }
.monitor-table th:nth-child(6),
.monitor-table td:nth-child(6) { min-width: 80px; }
.monitor-table th:nth-child(7),
.monitor-table td:nth-child(7) { min-width: 85px; }

.data-table th,
.data-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.data-table th {
  background: rgba(26, 23, 38, 0.9);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tbody tr {
  transition: background 0.15s ease;
  color: rgba(255, 255, 255, 0.9);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.08);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.data-table tbody tr.pending-row-done {
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.12);
}

.data-table .delete-btn,
.data-table .monitor-delete {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 1.15rem;
  transition: color 0.2s ease;
}

.data-table .delete-btn:hover,
.data-table .monitor-delete:hover {
  color: var(--red);
}

.data-table .monitor-edit {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  background: var(--navy-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 0.35rem;
  transition: background 0.2s ease;
}

.data-table .monitor-edit:hover {
  background: var(--navy-900);
}

.data-table .monitor-reopen {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 0.35rem;
  transition: background 0.2s ease;
}

.data-table .monitor-reopen:hover {
  background: var(--teal-light);
}

.btn-resume-paused {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-resume-paused:hover {
  background: var(--green-light);
}

.monitor-actions {
  white-space: nowrap;
}

/* Edit Activity Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: rgba(37, 34, 54, 0.98);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.25rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
}

.monitor-edit-form .form-row {
  margin-bottom: 0.9rem;
}

.billing-confirm-message {
  margin: 0.5rem 0 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.modal-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-hint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.modal-actions-end-options {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-forward {
  background: var(--teal);
  color: white;
}

.btn-forward:hover {
  background: var(--teal-light);
}

.readonly-prefill {
  background: rgba(255, 255, 255, 0.06);
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.9);
}

.activity-assign-buttons {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* Operational Reports */
.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.4rem 0.75rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.reports-filter-grid .form-row {
  margin-bottom: 0;
}

.reports-filter-grid .form-row label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.reports-filter-grid .filter-actions {
  align-items: flex-end;
}

.report-export-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.btn-export {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
}

.btn-export-excel {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn-export-excel:hover {
  background: var(--green-light);
  border-color: var(--green-light);
}

.btn-export-csv {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

.btn-export-csv:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
}

.btn-export-pdf {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn-export-pdf:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

.storage-report-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.storage-report-form .form-row {
  margin-bottom: 0;
}

.storage-report-form .form-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.storage-report-form .filter-actions {
  align-items: flex-end;
}

.storage-report-summary {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

/* Customer Billing Summary */
.billing-filter-card .card-title {
  margin-bottom: 0.4rem;
}

.billing-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.4rem 0.75rem;
  align-items: end;
}

.billing-filter-grid .form-row {
  margin-bottom: 0;
}

.billing-filter-grid .form-row label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.billing-filter-grid .filter-actions {
  align-items: flex-end;
}

.billing-export-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.billing-export-row .card-title {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.billing-export-buttons {
  display: flex;
  gap: 0.35rem;
}

.billing-select-col {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

.billing-select-col input[type="checkbox"] {
  cursor: pointer;
}

.billing-billed-col {
  font-size: 0.9rem;
}

.billing-not-billed {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.billing-billed-col {
  white-space: nowrap;
}

.billing-billed-col .billing-billed-value {
  margin-right: 0.35rem;
}

.btn-edit-billed {
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
}

.btn-edit-billed:hover {
  background: rgba(255, 255, 255, 0.18);
}

.billing-billed-select {
  min-width: 140px;
  padding: 0.25rem 0.4rem;
  font-size: 0.9rem;
  background: var(--navy-800);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Consolidated Result – financial summary, accounting-style */
.billing-consolidated-result {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(26, 23, 38, 0.75);
  max-width: 560px;
}

.billing-consolidated-result .consolidated-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.billing-consolidated-result .consolidated-period-label {
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  color: var(--teal-light);
}

.billing-consolidated-result .consolidated-context {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.consolidated-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.consolidated-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.5rem 0 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.consolidated-table thead th.col-amount {
  text-align: right;
}

.consolidated-table tbody td {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.consolidated-table tbody td.col-customer {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.consolidated-table tbody td.col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--teal-light);
  font-weight: 600;
}

.consolidated-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(79, 70, 229, 0.15);
  border-radius: var(--radius);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.consolidated-total-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.consolidated-total-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

/* Activity Log page – audit trail (dark theme) */
.activity-log-page {
  background: linear-gradient(180deg, #1a1726 0%, #252238 50%, #1a1726 100%);
  color: #fff;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-lg);
  margin-bottom: 0.6rem;
}

.activity-log-page .page-heading.activity-log-heading {
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
}

.activity-log-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.activity-log-filters-card {
  background: rgba(37, 34, 54, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.6rem;
}

.activity-log-filters-card .card-title {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.activity-log-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.75rem;
}

.activity-log-filter-grid .form-row {
  margin-bottom: 0;
}

.activity-log-filter-grid label {
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.activity-log-filter-grid input[type="date"],
.activity-log-filter-grid select {
  background: rgba(26, 23, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  min-width: 120px;
  font-size: 1rem;
}

.activity-log-filter-grid input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.7;
}

.activity-log-filter-actions {
  display: flex;
  gap: 0.5rem;
}

.activity-log-page .btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.activity-log-page .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.activity-log-table-card {
  background: rgba(45, 42, 62, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.activity-log-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-log-table thead {
  background: #2d2a3e;
}

.activity-log-table thead th {
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-log-table tbody tr {
  background: rgba(37, 34, 50, 0.8);
  color: rgba(255, 255, 255, 0.95);
}

.activity-log-table tbody tr:nth-child(even) {
  background: rgba(45, 42, 62, 0.9);
}

.activity-log-table tbody td {
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.activity-log-empty {
  color: rgba(255, 255, 255, 0.8);
  padding: 1rem 1.25rem;
  margin: 0;
}

/* Activity list */
.activity-list {
  max-height: 360px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--white);
  color: var(--navy-900);
  transition: box-shadow 0.2s ease;
}

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

.activity-item .info {
  flex: 1;
  min-width: 0;
}

.activity-item .date {
  font-size: 0.85rem;
  color: var(--grey-600);
}

.activity-item .customer {
  font-weight: 600;
  color: var(--navy-900);
}

.activity-item .type {
  font-size: 0.8125rem;
  color: var(--grey-600);
}

.activity-item .desc {
  font-size: 0.9rem;
  color: var(--grey-600);
}

.activity-item .activity-status {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.activity-item .status-in-progress {
  color: var(--orange);
}

.activity-item .status-paused {
  color: #d97706;
}

.activity-item .status-complete {
  color: var(--green);
}

.activity-item .qty {
  font-weight: 600;
  color: var(--success);
}

.customer-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.activity-item .delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.activity-item .delete-btn:hover {
  color: var(--red);
}

.empty-state {
  text-align: center;
  padding: 0.75rem 0.5rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
}

.card-hint {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.4rem;
}

.sample-downloads {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bulk-upload-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.file-input {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem !important;
  color: var(--text);
}

.file-input::file-selector-button {
  background: var(--border);
  color: var(--text);
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  margin-right: 0.5rem;
}

/* Bill */
.bill-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.bill-controls .form-row {
  margin-bottom: 0;
  min-width: 140px;
}

.bill-preview {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.bill-preview.hidden {
  display: none !important;
}

.bill-header {
  margin-bottom: 0.65rem;
}

.bill-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.bill-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.bill-table {
  width: 100%;
  min-width: 600px;
  table-layout: auto;
  border-collapse: collapse;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.bill-table th,
.bill-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.bill-table th:nth-child(1),
.bill-table td:nth-child(1) { min-width: 100px; }
.bill-table th:nth-child(2),
.bill-table td:nth-child(2) { min-width: 90px; }
.bill-table th:nth-child(3),
.bill-table td:nth-child(3) { min-width: 140px; }
.bill-table th:nth-child(4),
.bill-table td:nth-child(4) { min-width: 70px; }
.bill-table th:nth-child(5),
.bill-table td:nth-child(5) { min-width: 70px; }

.bill-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bill-table tfoot .total-row,
.data-table tfoot .total-row {
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.95);
}

.bill-actions {
  margin-top: 0.65rem;
}

/* User & Authorization */
.user-form .form-grid {
  margin-bottom: 0.75rem;
}

.btn-add-user {
  margin-top: 0.25rem;
}

.user-table .btn-edit-user {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: var(--navy-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 0.4rem;
  transition: background 0.2s ease;
}

.user-table .btn-edit-user:hover {
  background: var(--navy-900);
}

.user-table .btn-delete-user {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-table .btn-delete-user:hover {
  background: var(--red-hover);
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-user {
  background: rgba(13, 148, 136, 0.15);
  color: var(--teal);
}

.role-supervisor {
  background: rgba(234, 88, 12, 0.12);
  color: var(--orange);
}

.role-admin {
  background: var(--navy-700);
  color: var(--white);
}

/* Edit form in customer list */
.edit-customer-input {
  width: 100%;
  margin-bottom: 0.4rem;
  background: rgba(26, 23, 38, 0.8);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.edit-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-save-edit {
  background: var(--btn-start);
  color: white;
  padding: 0.35rem 0.65rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-cancel-edit {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.35rem 0.65rem;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.25s ease-out;
  max-width: 320px;
}

.toast.toast-success {
  background: var(--green);
}

.toast.toast-error {
  background: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive – tablet */
@media (max-width: 992px) {
  .top-header {
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
  }

  .header-center {
    order: 3;
    flex-basis: 100%;
    text-align: left;
    padding: 0.25rem 0 0;
  }

  .app-title {
    font-size: 0.95rem;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  .sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    cursor: pointer;
    margin-right: 0.5rem;
  }

  .sidebar-toggle .hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
  }

  .main-content {
    padding: 0.75rem;
  }

  .content-card {
    padding: 0.85rem 1rem;
  }

  .monitor-filter-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .billing-filter-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .billing-export-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .billing-consolidated-result {
    max-width: 100%;
  }

  .consolidated-total-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Performance Analytics dashboard */
.analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.analytics-filters .form-row { margin-bottom: 0; }
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.analytics-kpi-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(13, 148, 136, 0.1));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.analytics-kpi-card .kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--teal-light); }
.analytics-kpi-card .kpi-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); margin-top: 0.25rem; }
.analytics-summary { margin-bottom: 1.5rem; font-size: 0.95rem; line-height: 1.6; }
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.analytics-charts-grid .chart-card { min-height: 280px; }
.analytics-charts-grid .chart-wrap { height: 240px; position: relative; }
.analytics-heatmap-section { margin-bottom: 1rem; }
.heatmap-wrap {
  overflow-x: auto;
  padding: 0.5rem 0;
}
.analytics-heatmap-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 100%;
}
.analytics-heatmap-table th,
.analytics-heatmap-table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  min-width: 50px;
}
.analytics-heatmap-table th { background: rgba(0,0,0,0.2); font-weight: 600; }
.heatmap-cell {
  transition: opacity 0.2s;
}
.heatmap-cell:hover { opacity: 0.9; }

/* Responsive – mobile */
@media (max-width: 768px) {
  .analytics-charts-grid { grid-template-columns: 1fr; }
  .analytics-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .top-header {
    padding: 0.4rem 0.6rem;
  }

  .logo-text {
    font-size: 1.5rem;
  }
  .top-header .logo-img {
    height: 2.75rem;
    max-width: 220px;
  }

  .app-title {
    font-size: 0.85rem;
  }

  .header-user-info {
    font-size: 0.85rem;
  }

  .sidebar {
    width: 260px;
  }

  .main-content {
    padding: 0.6rem;
  }

  .page-heading {
    font-size: 1.25rem;
  }

  .content-card {
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.6rem;
  }

  .form-grid {
    gap: 0.5rem 0;
  }

  .activity-status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .activity-buttons {
    margin-left: 0;
  }

  .btn,
  .btn-start,
  .btn-end {
    min-height: 44px;
    padding: 0.6rem 1rem;
  }

  .monitor-table th:nth-child(1),
  .monitor-table td:nth-child(1) { min-width: 90px; }
  .monitor-table th:nth-child(2),
  .monitor-table td:nth-child(2) { min-width: 110px; }
  .monitor-table th:nth-child(4),
  .monitor-table td:nth-child(4) { min-width: 85px; }
  .monitor-table th:nth-child(5),
  .monitor-table td:nth-child(5) { min-width: 85px; }

  .modal-content {
    margin: 0 0.75rem;
    max-width: calc(100% - 1.5rem);
  }
}

/* Responsive – small mobile */
@media (max-width: 480px) {
  .login-card {
    padding: 1.25rem 1rem;
    margin: 0 0.5rem;
  }

  .header-left .logo-text {
    display: none;
  }

  .app-title {
    font-size: 0.8rem;
  }

  .btn-logout {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
  }

  .page-heading {
    font-size: 1.15rem;
  }

  input[type="text"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .master-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.5rem;
  }

  .master-tab {
    flex-shrink: 0;
  }
}

/* Desktop: hide sidebar toggle */
@media (min-width: 993px) {
  .sidebar-toggle {
    display: none;
  }
}

/* Print */
@media print {
  .top-header,
  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .activity-status-row,
  .activity-buttons,
  .bill-controls,
  .bill-actions,
  .filter-row,
  .toast-container {
    display: none !important;
  }

  .main-content {
    padding: 0;
    background: var(--white);
  }

  .main-content::before {
    display: none;
  }

  .content-card {
    box-shadow: none;
    background: var(--white);
    color: var(--navy-900);
    border-color: var(--grey-200);
  }

  .bill-table th,
  .bill-table td {
    border-color: var(--grey-200);
  }
}
