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

:root {
  /* Customer portal uses a soft teal/sage theme (staff portal keeps blue) */
  --ice-primary: #469b7e;
  --ice-primary-dark: #2f7d63;
  --ice-primary-soft: #e6f4ee;
  --ice-accent: #86cbb3;
  --ice-success: #15a46f;
  --ice-warning: #f59e0b;
  --ice-danger: #e5484d;
  --ice-text: #1e2b26;
  --ice-muted: #647770;
  --ice-line: #d6e8e0;
  --ice-bg: #f4faf7;
  --ice-card: rgba(255, 255, 255, 0.94);
  --ice-shadow: 0 18px 45px rgba(47, 125, 99, 0.16);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  color: var(--ice-text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(134, 203, 179, 0.22), transparent 34rem),
    linear-gradient(135deg, #f7fbf9 0%, #ecf5f1 45%, #f8fcfa 100%);
}
a { color: var(--ice-primary); }
a:hover, a:focus { color: var(--ice-primary-dark); }

.navbar.navbar-default {
  min-height: 68px;
  margin-bottom: 32px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(20, 32, 51, 0.10);
  backdrop-filter: blur(14px);
}
.navbar-default .navbar-brand {
  height: 68px;
  padding: 22px 20px;
  color: var(--ice-primary-dark) !important;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.navbar-default .navbar-brand:before {
  content: '❄';
  display: inline-block;
  width: 34px;
  height: 34px;
  margin: -8px 10px 0 0;
  color: #fff;
  line-height: 34px;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent));
  box-shadow: 0 10px 22px rgba(70, 155, 126, 0.28);
  vertical-align: middle;
}
.navbar-default .navbar-nav > li > a {
  padding-top: 24px;
  padding-bottom: 24px;
  color: #43536a;
  font-weight: 700;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: var(--ice-primary-dark);
  background: var(--ice-primary-soft);
}
.navbar-default .navbar-toggle {
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ice-primary-soft);
}
.dropdown-menu {
  padding: 10px;
  border: 1px solid var(--ice-line);
  border-radius: 16px;
  box-shadow: var(--ice-shadow);
  z-index: 1000;
}

/* Sidebar Layout */
.layout-container {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--ice-primary-dark) 0%, var(--ice-primary) 100%);
  color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar-brand a {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.sidebar-brand a:before {
  content: '❄';
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  vertical-align: middle;
  text-align: center;
  line-height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
}
.sidebar-menu {
  padding: 15px 0;
  list-style: none;
  margin: 0;
}
.sidebar-menu li {
  margin: 0;
  padding: 0;
}
.sidebar-menu li.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 8px 15px;
}
.sidebar-menu li a {
  display: block;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-menu li a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-left-color: #fff;
}
.sidebar-menu li a .glyphicon {
  margin-right: 10px;
  font-size: 16px;
}
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar-footer .user-info {
  color: rgba(255, 255, 255, 0.8);
}
.sidebar-footer small {
  display: block;
  font-size: 12px;
  opacity: 0.8;
}
.sidebar-footer .user-level {
  display: block;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}
.main-content {
  margin-left: 240px;
  width: calc(100% - 240px);
  padding-top: 0;
  min-height: 100vh;
}
.main-content .container-fluid {
  padding-top: 20px;
}

.mobile-menu-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 101;
  display: none;
}
.mobile-menu-toggle .btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  color: #2f7d63 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid #d6e8e0;
}
.mobile-menu-toggle .btn:hover,
.mobile-menu-toggle .btn:focus {
  background: #e6f4ee;
}
.mobile-menu-toggle .glyphicon {
  font-size: 18px;
}

/* Mobile responsive - Collapse sidebar on small screens */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .navbar-toggle {
    display: block !important;
  }
  .sidebar-menu li a {
    padding: 16px 20px;
  }
  .page-header h2 {
    font-size: 24px;
  }
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
}
.dropdown-menu > li > a {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.dropdown-menu > li > a:hover { background: var(--ice-primary-soft); }
.nav-welcome {
  float: right;
  margin: 14px 0 0 14px;
  padding: 8px 14px;
  color: var(--ice-primary-dark);
  border: 1px solid var(--ice-line);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
}
.nav-welcome small { color: var(--ice-muted); font-weight: 600; }

.container-fluid {
  max-width: 1200px;
  padding-left: 15px;
  padding-right: 15px;
}
.page-shell { padding-bottom: 42px; }

/* Ensure all main containers have consistent width - EXCEPT dashboard-grid cards */
.container-fluid > .row:not(.dashboard-grid) > [class*="col-"],
.form-card,
.table-card,
.search-panel,
.well,
.panel.panel-default,
body:not(.login-page) form.form-horizontal,
body:not(.login-page) form[enctype='multipart/form-data'] {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Ensure all columns are full width on mobile and desktop - EXCEPT dashboard-grid */
.container-fluid > .row:not(.dashboard-grid) > .col-xs-12,
.container-fluid > .row:not(.dashboard-grid) > [class*="col-"] {
  width: 100%;
  float: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Keep dashboard grid cards original layout */
.dashboard-grid .col-md-3,
.dashboard-grid .col-sm-6 {
  float: left;
  width: 25%;
  padding-left: 15px;
  padding-right: 15px;
}
@media (max-width: 991px) {
  .dashboard-grid .col-md-3.col-sm-6 {
    width: 50%;
  }
}
@media (max-width: 767px) {
  .dashboard-grid .col-md-3.col-sm-6 {
    width: 100%;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }

  .dashboard-card {
    padding: 15px !important;
  }

  body:not(.login-page) form.form-horizontal,
  body:not(.login-page) form[enctype='multipart/form-data'] {
    padding: 15px;
  }
}
.page-header { margin: 0 0 22px; padding-bottom: 14px; border-bottom: 0; }
.page-header h2,
.page-title {
  margin: 0;
  color: var(--ice-primary-dark);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.page-subtitle { margin: 8px 0 0; color: var(--ice-muted); font-size: 14px; }

.ui-card,
.form-card,
.table-card,
.panel.panel-default {
  border: 1px solid rgba(217, 229, 242, 0.86);
  border-radius: 24px;
  background: var(--ice-card);
  box-shadow: var(--ice-shadow);
  overflow: hidden;
}
.form-card { padding: 30px; margin-bottom: 34px; }
.table-card { padding: 0; margin-bottom: 28px; }
.table-card .page-header { padding: 26px 30px 0; }
.table-responsive { border: 0; }
.panel.panel-default > .panel-heading {
  color: var(--ice-primary-dark);
  border-color: var(--ice-line);
  background: linear-gradient(135deg, #f7fbf9, #e3f1eb);
  font-weight: 800;
}
.panel.panel-default > .panel-body { color: var(--ice-muted); }

.form-horizontal .form-group { margin-bottom: 18px; }
.control-label { color: #41516a; font-weight: 700; }
.form-control,
.form-control-file,
select.form-control,
input[type='file'] {
  min-height: 44px;
  border: 1px solid #d5e2ef;
  border-radius: 12px;
  box-shadow: none;
  color: var(--ice-text);
  background-color: #fff;
}
.form-control:focus { border-color: var(--ice-accent); box-shadow: 0 0 0 4px rgba(134, 203, 179, 0.14); }
.form-control[readonly] { background: #f4faf7; color: #66768d; }
.radio label { font-weight: 600; color: #43536a; }

.btn {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover, .btn:focus { transform: translateY(-1px); }
.btn-default, .btn-primary, .btn-info {
  color: #fff !important;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent));
  box-shadow: 0 10px 22px rgba(70, 155, 126, 0.22);
}
.btn-default:hover, .btn-primary:hover, .btn-info:hover,
.btn-default:focus, .btn-primary:focus, .btn-info:focus { background: linear-gradient(135deg, var(--ice-primary-dark), var(--ice-primary)); }
.btn-success { background: var(--ice-success); color: #fff !important; }
.btn-warning { background: var(--ice-warning); color: #fff !important; }
.btn-danger { background: var(--ice-danger); color: #fff !important; }
.btn-xs { padding: 6px 10px; margin: 2px; }
.btn-block { padding: 12px 18px; }

.table { margin-bottom: 0; background: #fff; }
.table > thead > tr > th,
.table > tbody > tr:first-child > th,
.table > tr:first-child > th {
  color: var(--ice-primary-dark);
  border-bottom: 1px solid var(--ice-line) !important;
  background: #ecf6f1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tr > td,
.table > tr > th { border-color: #edf3f8 !important; vertical-align: middle !important; }
.table-striped > tbody > tr:nth-of-type(odd) { background-color: #fbfdff; }
.table-striped > tbody > tr:hover { background-color: #eef8ff; }
.table-bordered { border-color: var(--ice-line); }
.table-card .table { min-width: 780px; }

.pagination > li > a,
.pagination > li > span {
  margin: 0 8px;
  color: var(--ice-primary);
  border: 1px solid var(--ice-line);
  border-radius: 10px !important;
  font-weight: 700;
  padding: 8px 16px;
}
.pagination > li > a:hover,
.pagination > li > span:hover {
  background-color: var(--ice-primary-soft);
  border-color: var(--ice-primary);
}
.pagination > .active > a,
.pagination > .active > span {
  border-color: var(--ice-primary);
  background: var(--ice-primary);
  color: white;
}
.pagination > .disabled > a,
.pagination > .disabled > span {
  opacity: 0.5;
  cursor: not-allowed;
}

.dataTables_wrapper { padding: 0 30px 28px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #d5e2ef;
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
}
.dt-buttons .dt-button,
button.dt-button {
  border: 0 !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent)) !important;
  font-weight: 800;
}

/* ===== DataTables card layout (matches the staff portal design) =====
   Structure generated by the dom config:
   .history-card > .history-card-head (.history-length=l, .history-search=f, B=button)
                  .history-table-wrap (t+r)
                  .history-card-foot (i=info, p=pagination) */
.history-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-head-right .dt-buttons { float: none; }
.btn-history-export {
  width: 38px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.history-card {
  background: #fff;
  border: 1px solid var(--ice-line, #d6e8e0);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(20, 32, 51, .07);
  padding: 20px 24px 16px;
  margin-bottom: 30px;
}
.history-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.history-card-head .dataTables_length,
.history-card-head .dataTables_filter {
  float: none;
  margin: 0;
  text-align: left;
}
.history-card-head .dataTables_length label,
.history-card-head .dataTables_filter label {
  font-weight: 500;
  color: #5a6b7b;
  margin: 0;
}
.history-card-head .dataTables_length select {
  width: auto;
  display: inline-block;
  margin: 0 8px 0 0;
}
.history-search .dataTables_filter label {
  position: relative;
  display: inline-block;
}
.history-search .dataTables_filter label::before {
  content: "\e003"; /* glyphicon-search */
  font-family: 'Glyphicons Halflings';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #97a5b3;
  font-size: 13px;
  pointer-events: none;
}
.history-search .dataTables_filter input {
  margin-left: 0;
  padding-left: 32px;
  width: 240px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ice-line, #d8e0e8);
  box-shadow: none;
}
.history-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
}
.history-card-foot .dataTables_info {
  flex: 0 0 auto;
  padding-top: 0;
}
.history-card-foot .dataTables_paginate {
  flex: 0 0 auto;
  float: none !important;
  width: auto !important;
  margin: 0 0 0 auto !important;
  display: flex !important;
  justify-content: flex-end !important;
}
.history-card .table { margin-bottom: 0; }
/* The table fills the whole card (the site-wide .container-fluid .table rule
   caps sparse tables at 1200px & centres them). min-width:100% beats
   DataTables' inline pixel width. */
.history-card .history-table-wrap {
  width: 100%;
  display: block;
}
.history-card .table,
.dataTables_wrapper.history-card .table {
  display: table;
  table-layout: auto;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* Icon-only action buttons (name shown via the title tooltip on hover) */
.table .btn.btn-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: #fff;
}
.table .btn.btn-icon .glyphicon {
  top: 0;
  margin: 0;
}
.table td.actions .btn.btn-icon {
  margin: 3px 4px;
}
.table td.actions {
  white-space: nowrap;
}
.history-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 42px 15px;
  /* Fixed teal wash over a light base (no background image) */
  background:
    linear-gradient(
      125deg,
      rgba(47, 125, 99, 0.95),
      rgba(56, 142, 113, 0.90),
      rgba(134, 203, 179, 0.86),
      rgba(167, 216, 197, 0.83)
    ),
    linear-gradient(135deg, #e3f1eb, #ffffff);
  background-attachment: fixed;
}
.login-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 38px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 30px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 28px 70px rgba(47, 125, 99, .22);
  backdrop-filter: blur(18px);
}
.login-brand { margin-bottom: 20px; text-align: center; }
.login-brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(70, 155, 126, .18);
}
.login-brand h1 { margin: 0; color: var(--ice-primary-dark); font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.login-brand p { margin: 8px 0 0; color: var(--ice-muted); }
.error {
  padding: 12px 14px;
  color: #8f1d22;
  border: 1px solid #ffd1d4;
  border-radius: 14px;
  background: #fff2f3;
  font-weight: 700;
}

.hero-dashboard {
  position: relative;
  overflow: hidden;
  margin: 0 0 32px;
  padding: 44px;
  color: #fff;
  border-radius: 32px;
  /* Base teal gradient (mobile + fallback). On desktop the ::after layer
     paints the illustration full-bleed with a teal wash over its left side */
  background: linear-gradient(135deg, #2f7d63 0%, #469b7e 70%, #86cbb3 100%);
  box-shadow: var(--ice-shadow);
}
/* Illustration scaled past the card edges (no hard image edge can land
   inside the card); an opaque-teal -> transparent wash sits ON TOP of it
   and dissolves the picture into solid teal behind the text */
.hero-dashboard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(47, 125, 99, 1)    0%,
      rgba(47, 125, 99, .97) 16%,
      rgba(47, 125, 99, .85) 36%,
      rgba(47, 125, 99, .55) 52%,
      rgba(47, 125, 99, .20) 66%,
      rgba(47, 125, 99, 0)   78%),
    url('../hero.jpg?v=cus3') right center / auto 135% no-repeat;
}
.hero-dashboard > * { position: relative; z-index: 1; }
/* The illustration lives on .hero-dashboard::after and keeps itself
   right-anchored / full-height at every desktop/tablet width. */
.hero-dashboard h1 { margin: 0 0 10px; font-size: 38px; font-weight: 800; letter-spacing: -.06em; }
.hero-dashboard p { max-width: 650px; margin: 0; color: rgba(255,255,255,.82); font-size: 16px; }
.quick-actions { margin-top: 24px; }
.quick-actions .btn { margin-right: 10px; margin-bottom: 10px; background: #fff; color: var(--ice-primary-dark) !important; }
.dashboard-grid { margin-bottom: 30px; }
.dashboard-card {
  min-height: 150px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--ice-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 32, 51, .08);
}
.dashboard-card .icon {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  color: #fff;
  line-height: 46px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent));
}
.dashboard-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: var(--ice-primary-dark); }
.dashboard-card p { color: var(--ice-muted); }
.upload-zone { padding: 28px; border: 2px dashed #b3d8c8; border-radius: 22px; background: #f6faf8; }
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--ice-shadow); overflow: hidden; }
.modal-header { color: var(--ice-primary-dark); background: #ecf6f1; border-bottom-color: var(--ice-line); }
.modal-footer { border-top-color: var(--ice-line); }
.well { border: 1px solid var(--ice-line); border-radius: 22px; background: #fff; box-shadow: var(--ice-shadow); }
.invoice-page { padding: 36px; background: #fff; }
.invoice-logo { max-width: 150px; height: auto; }
.invoice-title { color: var(--ice-primary-dark); font-weight: 800; letter-spacing: -.05em; }

@media (max-width: 767px) {
  .navbar.navbar-default { min-height: 60px; }
  .navbar-default .navbar-brand { height: 60px; padding-top: 18px; }
  .navbar-default .navbar-nav > li > a { padding-top: 12px; padding-bottom: 12px; }
  .nav-welcome { float: none; display: inline-block; margin: 10px 15px 16px; }
  .form-card { padding: 22px; }
  .login-card { padding: 28px 22px; }
  .hero-dashboard { padding: 30px 24px; }
  .hero-dashboard h1 { font-size: 30px; }
  .table-card .page-header, .dataTables_wrapper { padding-left: 18px; padding-right: 18px; }
}

@media print {
  body, .invoice-page { background: #fff; }
  .navbar, .btn { display: none !important; }
  .ui-card, .panel.panel-default, .table-card { box-shadow: none; }
}

body:not(.login-page) form.form-horizontal,
body:not(.login-page) form[enctype='multipart/form-data'] {
  padding: 30px;
  margin-bottom: 34px;
  border: 1px solid rgba(217, 229, 242, 0.86);
  border-radius: 24px;
  background: var(--ice-card);
  box-shadow: var(--ice-shadow);
}
body:not(.login-page) .container-fluid > .row > [class*='col-'],
body:not(.login-page) .container > .row > [class*='col-'] { margin-bottom: 28px; }
body:not(.login-page) .table-bordered,
body:not(.login-page) .table-striped {
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(20, 32, 51, .08);
}
body:not(.login-page) .page-header + .table,
body:not(.login-page) .page-header + .table-responsive { margin-top: 8px; }
body:not(.login-page) h2.text-center,
body:not(.login-page) h3.text-center {
  color: var(--ice-primary-dark);
  font-weight: 800;
  letter-spacing: -.04em;
}
.container { max-width: 1180px; }

.table-responsive,
body:not(.login-page) .table {
  width: 100%;
}
body:not(.login-page) .table {
  display: block;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
}
body:not(.login-page) .table > thead,
body:not(.login-page) .table > tbody {
  display: table;
  width: 100%;
  min-width: 780px;
}

.btn:focus,
.navbar a:focus,
.dropdown-menu > li > a:focus,
.form-control:focus {
  outline: 3px solid rgba(134, 203, 179, 0.28);
  outline-offset: 2px;
}
.table-responsive:before {
  content: 'Swipe horizontally to view all columns';
  display: none;
  margin: 0 0 10px;
  color: var(--ice-muted);
  font-size: 12px;
  font-weight: 700;
}
.actions,
td:last-child {
  white-space: nowrap;
}
.help-block {
  color: var(--ice-muted);
  font-weight: 600;
}
@media (max-width: 767px) {
  body:not(.login-page) form.form-horizontal,
  body:not(.login-page) form[enctype='multipart/form-data'] {
    padding: 22px;
  }
  .form-horizontal .control-label {
    text-align: left;
    margin-bottom: 8px;
  }
  .form-horizontal .form-group .btn {
    width: 100%;
    margin: 6px 0;
  }
  .quick-actions .btn {
    display: block;
    width: 100%;
    margin-right: 0;
  }
  .table-responsive:before {
    display: block;
  }
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length,
  .dt-buttons {
    float: none !important;
    text-align: left !important;
    margin: 8px 0;
  }
}
@media (max-width: 480px) {
  .login-page {
    padding: 22px 10px;
  }
  .login-card {
    padding: 24px 18px;
    border-radius: 24px;
  }
  .login-brand h1,
  .hero-dashboard h1,
  .page-header h2,
  .page-title {
    font-size: 24px;
  }
  .hero-dashboard {
    padding: 24px 18px;
    background-image: linear-gradient(135deg, rgba(47, 125, 99, .98), rgba(70, 155, 126, .86));
  }
  .hero-dashboard::after { display: none; }
  .nav-welcome {
    width: calc(100% - 30px);
    text-align: center;
  }
}

/* Desktop login and compact lorry detail refinements */
@media (min-width: 992px) {
  .login-card {
    max-width: 680px;
    padding: 48px 56px;
  }
  .login-brand img {
    width: 116px;
    height: 116px;
  }
  .login-brand h1 {
    font-size: 36px;
  }
  .login-brand p {
    font-size: 16px;
  }
}
.lorry-detail-table,
body:not(.login-page) .lorry-detail-table {
  display: table;
  width: 100%;
  min-width: 0;
  overflow: visible;
  box-shadow: none;
  border-radius: 0;
}
.lorry-detail-table tbody,
body:not(.login-page) .lorry-detail-table > tbody {
  display: table-row-group;
  min-width: 0;
  width: 100%;
}
.lorry-detail-table td:first-child {
  width: 42%;
  color: var(--ice-primary-dark);
}
.lorry-detail-table td:last-child {
  white-space: normal;
  word-break: break-word;
}
@media (max-width: 480px) {
  .lorry-detail-table td {
    display: block;
    width: 100% !important;
  }
  .lorry-detail-table td:first-child {
    padding-bottom: 2px;
    border-bottom: 0 !important;
  }
  .lorry-detail-table td:last-child {
    padding-top: 2px;
  }
}

/* Login form alignment fix */
.login-card .form-horizontal .form-group {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 26px;
}
.login-card .form-horizontal .control-label {
  display: block;
  float: none;
  width: 100%;
  padding-top: 0;
  margin-bottom: 10px;
  text-align: left;
  color: #41516a;
  font-size: 16px;
}
.login-card .form-horizontal .col-sm-9,
.login-card .form-horizontal .col-sm-offset-3 {
  float: none;
  width: 100%;
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
}
.login-card .form-control {
  width: 100%;
  height: 54px;
  font-size: 16px;
}
.login-card .btn-block {
  width: 100%;
  max-width: 340px;
  margin: 8px auto 0;
  display: block;
  height: 56px;
  font-size: 16px;
}
@media (min-width: 992px) {
  .login-card .btn-block {
    max-width: 380px;
  }
}

/* Stable lorry/DataTables layout */
.dataTables_wrapper .table,
body:not(.login-page) .dataTables_wrapper .table {
  display: table;
  width: 100% !important;
  min-width: 0;
  table-layout: auto;
  overflow: visible;
}
.dataTables_wrapper .table > thead,
.dataTables_wrapper .table > tbody,
body:not(.login-page) .dataTables_wrapper .table > thead,
body:not(.login-page) .dataTables_wrapper .table > tbody {
  display: table-row-group;
  min-width: 0;
  width: auto;
}
.dataTables_wrapper .table > thead {
  display: table-header-group;
}
.dataTables_wrapper .table th,
.dataTables_wrapper .table td {
  white-space: normal;
  word-break: normal;
}
.dataTables_wrapper .table td.actions,
.dataTables_wrapper .table th:last-child {
  white-space: nowrap;
  min-width: 150px;
}
.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.login-switch {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 16px;
  color: var(--ice-primary-dark);
  border: 1px solid var(--ice-line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}
.login-switch:hover,
.login-switch:focus {
  color: #fff;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent));
  text-decoration: none;
}

/* Required field indicator */
label .required {
  color: #e5484d;
  font-weight: bold;
}

/* Mobile menu improvements */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  display: none;
}
.sidebar-overlay.active {
  display: block;
}

.sidebar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  line-height: 36px;
  padding: 0;
}
.sidebar-close:hover {
  background: rgba(255,255,255,0.3);
}
@media (max-width: 767px) {
  .sidebar-close {
    display: block;
  }
}

/* Receipt modal styles */
.receipt-modal-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.search-panel {
  background: #fff;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid var(--ice-line);
  margin-bottom: 20px;
}
.search-panel .form-group {
  margin-bottom: 8px;
}
.search-panel .form-control {
  height: 38px;
}
.search-panel .btn {
  margin-top: 5px;
  height: 38px;
  padding: 6px 12px;
}

/* Compact search panel */
.search-panel-compact {
  margin-bottom: 0;
}
.search-panel-compact .form-group {
  margin-bottom: 5px;
}
.search-panel-compact label.small {
  font-size: 12px;
  margin-bottom: 3px;
  font-weight: 600;
  color: var(--ice-muted);
}
.search-panel-compact .form-control.input-sm {
  height: 34px;
  font-size: 13px;
  padding: 5px 10px;
}
.search-panel-compact .btn-sm {
  height: 34px;
  padding: 5px 12px;
  font-size: 12px;
}
.search-panel-compact .flex-grow {
  flex-grow: 1;
}

/* ========== 下面是添加的修改 ========== */

/* Table alignment fixes - added */
table.table {
  table-layout: auto;
  width: 100%;
}
table.table th,
table.table td {
  text-align: center;
  vertical-align: middle;
  word-wrap: break-word;
  word-break: break-word;
}
table.table th {
  text-align: center;
  vertical-align: middle;
}
table.table td.actions,
table.table th:last-child {
  text-align: center;
  white-space: nowrap;
}
table.table td.price-column {
  text-align: center;
}
table.table td.date-column {
  text-align: center;
  white-space: nowrap;
}

/* Ensure all tables have consistent width */
.container-fluid .table,
.container .table {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Fix table alignment in customer-login pages */
body:not(.login-page) .table {
  display: table !important;
  table-layout: auto !important;
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body:not(.login-page) .table > thead,
body:not(.login-page) .table > tbody {
  display: table-row-group !important;
  width: 100% !important;
}

/* Colorful cards for price/paid/balance */
.price-card-blue {
  background: linear-gradient(135deg, #469b7e 0%, #357f66 100%);
  color: #fff;
  text-align: center;
  border: none;
  box-shadow: 0 10px 25px rgba(70, 155, 126, 0.3);
}
.price-card-green {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
  color: #fff;
  text-align: center;
  border: none;
  box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}
.price-card-orange {
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
  color: #fff;
  text-align: center;
  border: none;
  box-shadow: 0 10px 25px rgba(255, 152, 0, 0.3);
}

.price-card-blue .glyphicon,
.price-card-green .glyphicon,
.price-card-orange .glyphicon {
  font-size: 40px;
  margin-bottom: 15px;
  opacity: 0.9;
}
.price-card-blue h3,
.price-card-green h3,
.price-card-orange h3 {
  color: #fff !important;
  font-size: 32px;
  margin: 0 0 10px 0;
}
.price-card-blue p,
.price-card-green p,
.price-card-orange p {
  color: rgba(255, 255, 255, 0.95) !important;
  margin: 0;
  font-size: 18px;
}

/* Login icon style for customer login */
.login-brand .login-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--ice-primary), var(--ice-accent));
  box-shadow: 0 12px 28px rgba(70, 155, 126, .18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-brand .login-icon .glyphicon {
  font-size: 48px;
  color: #fff;
}

/* ============================================================
   Login page: entrance animation + portal-switch exit animation
   ============================================================ */
@keyframes loginBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes loginCardIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes loginItemIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes loginIconPop {
  0%   { opacity: 0; transform: scale(.4) rotate(-10deg); }
  70%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes loginCardOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-20px) scale(.96); }
}

/* Entrance: background fades in, card pops in, contents rise in a stagger */
.login-page { animation: loginBgIn .45s ease both; }
.login-card { animation: loginCardIn .6s cubic-bezier(.22,.9,.32,1) both; }
.login-brand .login-icon { animation: loginIconPop .6s cubic-bezier(.34,1.4,.5,1) .12s both; }
.login-brand h1 { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .24s both; }
.login-brand p  { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .30s both; }
.login-switch   { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .36s both; }
.login-card .error { animation: loginItemIn .4s ease .5s both; }
.login-card form > .form-group:nth-of-type(1) { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .42s both; }
.login-card form > .form-group:nth-of-type(2) { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .48s both; }
.login-card form > .form-group:nth-of-type(3) { animation: loginItemIn .5s cubic-bezier(.22,.9,.32,1) .54s both; }

/* Exit: JS adds .is-leaving before navigating to the other portal's login */
.login-page.is-leaving { animation: loginBgIn .3s ease reverse forwards; }
.login-card.is-leaving { animation: loginCardOut .3s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  .login-page, .login-card, .login-brand .login-icon, .login-brand h1,
  .login-brand p, .login-switch, .login-card .error, .login-card .form-group {
    animation: none !important;
  }
}

/* ============================================================
   Dashboard homepage entrance animation
   Plays when the home page lands (right after login).
   Scope: <body class="dashboard-home"> on mainmenu.php.
   Fill mode "backwards" (not "both") so hover transforms keep
   working once the entrance animation has finished.
   ============================================================ */
@keyframes dashItemIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.dashboard-home .hero-dashboard {
  animation: dashItemIn .5s cubic-bezier(.22,.9,.32,1) .02s backwards;
}
/* KPI cards rise in one after another */
body.dashboard-home .kpi-mini,
body.dashboard-home .cust-kpi {
  animation: dashItemIn .55s cubic-bezier(.22,.9,.32,1) backwards;
}
body.dashboard-home .dash-kpi-col .kpi-mini:nth-child(1),
body.dashboard-home .dashboard-grid .cust-kpi:nth-child(1) { animation-delay: .16s; }
body.dashboard-home .dash-kpi-col .kpi-mini:nth-child(2),
body.dashboard-home .dashboard-grid .cust-kpi:nth-child(2) { animation-delay: .24s; }
body.dashboard-home .dash-kpi-col .kpi-mini:nth-child(3),
body.dashboard-home .dashboard-grid .cust-kpi:nth-child(3) { animation-delay: .32s; }
body.dashboard-home .dash-kpi-col .kpi-mini:nth-child(4) { animation-delay: .40s; }
/* Big statistics / analysis card follows the KPIs */
body.dashboard-home .payment-stats-card,
body.dashboard-home .pa-card {
  animation: dashItemIn .6s cubic-bezier(.22,.9,.32,1) .44s backwards;
}
@media (prefers-reduced-motion: reduce) {
  body.dashboard-home .hero-dashboard,
  body.dashboard-home .kpi-mini,
  body.dashboard-home .cust-kpi,
  body.dashboard-home .payment-stats-card,
  body.dashboard-home .pa-card {
    animation: none !important;
  }
}
