:root {
  --app-bg: #edf2f7;
  --panel-bg: #ffffff;
  --panel-border: #d6dfeb;
  --ink: #162338;
  --muted: #667892;
  --brand: #1f6feb;
  --brand-deep: #12356f;
  --brand-soft: #e6efff;
  --green: #099268;
  --amber: #d97706;
  --rose: #d9485f;
  --neutral: #5b6b82;
  --shadow: 0 20px 50px rgba(12, 31, 66, 0.09);
}

body,
.content-wrapper,
.right-side {
  background:
    radial-gradient(circle at top right, rgba(31, 111, 235, 0.08), transparent 24%),
    radial-gradient(circle at bottom left, rgba(9, 146, 104, 0.08), transparent 18%),
    linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Segoe UI", sans-serif;
}

h1, h2, h3, h4, h5, .logo-lg, .logo-mini {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.main-header .logo,
.main-header .navbar {
  background: linear-gradient(135deg, #13233d 0%, #1f6feb 100%);
}

.main-header .logo {
  color: #fff;
  border-bottom: 0;
}

.main-sidebar,
.left-side {
  background: linear-gradient(180deg, #101d33 0%, #172b49 100%);
}

.sidebar-menu > li > a,
.sidebar a {
  color: #e8eefc;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-menu .treeview-menu {
  background: rgba(7, 18, 39, 0.4);
}

.content-header {
  padding: 24px 24px 8px;
}

.content-header > h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.content {
  padding: 16px 24px 32px;
}

.box,
.app-content-box,
.metric-card,
.quick-link-card,
.workflow-card,
.app-shell-intro,
.document-shell {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.box {
  border-top: 0;
}

.box-header.with-border {
  border-bottom: 1px solid #e8eef8;
}

.box-title {
  color: var(--ink);
  font-weight: 700;
}

.app-shell-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(34, 111, 255, 0.98) 0%, rgba(16, 58, 140, 0.97) 100%);
  color: #fff;
}

.admin-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 22px;
  padding: 30px 32px;
  margin-bottom: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.2), transparent 26%),
    linear-gradient(135deg, #13233d 0%, #1f6feb 58%, #0f8b8d 100%);
  color: #fff;
  box-shadow: 0 26px 60px rgba(17, 38, 74, 0.22);
}

.admin-hero-panel h1 {
  margin: 10px 0 12px;
  font-size: 42px;
  color: #fff;
}

.admin-hero-panel p,
.admin-hero-panel .eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-insights {
  display: grid;
  gap: 14px;
}

.hero-stat {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.hero-stat span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-grid-admin {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.app-shell-intro h1 {
  margin: 8px 0 10px;
  color: #fff;
}

.app-shell-intro p,
.app-shell-intro .eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.intro-actions .btn {
  margin-left: 10px;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #226fff 0%, #103a8c 100%);
  border-color: transparent;
}

.btn-default {
  border-color: #d8e1f3;
  color: var(--ink);
}

.metric-card {
  padding: 22px 22px 18px;
  min-height: 150px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.metric-card:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 18px 0 0 18px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 30px;
  line-height: 1.1;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
}

.accent-sales:before { background: var(--brand); }
.accent-purchase:before { background: var(--green); }
.accent-receivable:before { background: var(--amber); }
.accent-payable:before { background: var(--rose); }
.accent-neutral:before { background: var(--neutral); }

.dashboard-chart-shell .box-header,
.data-panel .box-header,
.spotlight-panel .box-header {
  padding-bottom: 10px;
}

.dashboard-subtitle {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.spotlight-panel .box-body {
  padding-top: 10px;
}

.spotlight-tile {
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  border: 1px solid #d9e5f5;
}

.spotlight-tile span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--muted);
}

.spotlight-tile strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 26px;
  color: var(--ink);
}

.quick-links-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.quick-link-card {
  display: block;
  padding: 22px;
  margin-bottom: 24px;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-link-card:hover {
  color: inherit;
  transform: translateY(-3px);
  box-shadow: 0 28px 52px rgba(15, 35, 80, 0.12);
}

.quick-link-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.quick-link-card strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.quick-link-card p,
.workflow-card p {
  margin: 0;
  color: var(--muted);
}

.workflow-card {
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: none;
}

.workflow-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.document-shell {
  padding: 28px;
  margin-bottom: 24px;
}

.document-shell .section-heading {
  margin: 0 0 6px;
  font-size: 28px;
}

.document-shell .section-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.form-section-card {
  padding: 22px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.form-section-card .section-label {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.summary-pill {
  flex: 1 1 180px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f6f9ff;
  border: 1px solid #dce7fb;
}

.summary-pill span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.summary-pill strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.invoice-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.invoice-actions .btn {
  min-width: 170px;
  border-radius: 999px;
  font-weight: 700;
}

.table > thead > tr > th {
  border-bottom: 1px solid #e6edf8;
  color: var(--ink);
  font-weight: 700;
}

.table > tbody > tr > td {
  border-top: 1px solid #eef3fb;
}

.form-control,
.select2-container--default .select2-selection--single {
  border: 1px solid #cfd9ec !important;
  border-radius: 12px !important;
  min-height: 42px;
  box-shadow: none;
}

textarea.form-control,
textarea.form_control {
  min-height: 96px;
  width: 100%;
  border: 1px solid #cfd9ec;
  border-radius: 12px;
  padding: 10px 12px;
}

label {
  color: var(--ink);
  font-weight: 700;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 111, 255, 0.24), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0, 166, 118, 0.18), transparent 30%),
    linear-gradient(180deg, #eff5ff 0%, #edf2f8 100%);
}

.main-footer {
  background: rgba(255,255,255,0.92);
  border-top: 1px solid #d9e2ef;
  color: var(--muted);
}

.login-box {
  width: 430px;
  margin: 7vh auto;
}

.login-brand {
  text-align: center;
  margin-bottom: 18px;
}

.login-brand h1 {
  margin: 0 0 8px;
  font-size: 36px;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
}

.login-box-body {
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.login-box-msg {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.help-text {
  color: var(--muted);
  margin-bottom: 20px;
}

.app-content-box .box-body > div[id^="grocery-crud"] table,
.app-content-box .box-body > table {
  width: 100%;
}

@media (max-width: 767px) {
  .admin-hero-panel,
  .app-shell-intro,
  .invoice-actions {
    display: block;
  }

  .metric-grid-admin,
  .quick-links-strip {
    grid-template-columns: 1fr;
  }

  .intro-actions .btn,
  .invoice-actions .btn {
    display: block;
    width: 100%;
    margin: 12px 0 0;
  }

  .content-header,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .document-shell,
  .form-section-card,
  .app-shell-intro {
    padding: 20px;
  }

  .login-box {
    width: calc(100% - 24px);
    margin: 24px auto;
  }
}

@media (max-width: 1199px) {
  .metric-grid-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-hero-panel {
    grid-template-columns: 1fr;
  }
}
