/* LedgerLane — modern theme */
:root {
  --rm-bg: #f1f5f9;
  --rm-surface: #ffffff;
  --rm-surface-elevated: #ffffff;
  --rm-border: #e2e8f0;
  --rm-text: #0f172a;
  --rm-text-muted: #64748b;
  --rm-accent: #0d9488;
  --rm-accent-hover: #0f766e;
  --rm-accent-soft: rgba(13, 148, 136, 0.12);
  --rm-success: #059669;
  --rm-success-soft: rgba(5, 150, 105, 0.12);
  --rm-nav-bg: #0f172a;
  --rm-nav-text: #f8fafc;
  --rm-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --rm-shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.1);
  --rm-radius: 10px;
  --rm-radius-sm: 6px;
  --rm-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--rm-font);
  background: var(--rm-bg);
  color: var(--rm-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Layout: sidebar + main */
.layout-with-sidebar {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--rm-nav-bg);
  color: var(--rm-nav-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
  overflow-y: auto;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--rm-nav-text);
  text-decoration: none;
  padding: 1.5rem 1.25rem;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.15s;
}
.sidebar-brand:hover {
  color: var(--rm-nav-text);
  opacity: 0.9;
}
.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  color: rgba(248, 250, 252, 0.85);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--rm-radius-sm);
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0.2rem;
}
.sidebar-link:hover {
  color: var(--rm-nav-text);
  background: rgba(255, 255, 255, 0.08);
}
.sidebar-link.active {
  background: var(--rm-accent);
  color: #fff;
}
.sidebar-icon {
  font-size: 1.2rem;
  opacity: 0.9;
  width: 1.25em;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}
.sidebar-account {
  margin-bottom: 0.75rem;
}
.sidebar-account-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(248, 250, 252, 0.5);
  margin-bottom: 0.25rem;
}
.sidebar-user {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.95);
  padding: 0 0.25rem;
}
.sidebar-user-meta {
  display: block;
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.6);
  margin-top: 0.15rem;
  padding: 0 0.25rem;
}
.sidebar-link-logout {
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.9rem;
}
.sidebar-link-logout:hover {
  color: #fca5a5;
}
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--rm-bg);
}
.main-content-inner {
  flex: 1;
  padding: 1.5rem 2rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Navbar (kept for any standalone use) */
.navbar-ledgerlane {
  background: var(--rm-nav-bg) !important;
  box-shadow: var(--rm-shadow);
  padding: 0.6rem 0;
}
.navbar-ledgerlane .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--rm-nav-text) !important;
}
.navbar-ledgerlane .nav-link {
  color: rgba(248, 250, 252, 0.9) !important;
  font-weight: 500;
  padding: 0.4rem 0.75rem !important;
  border-radius: var(--rm-radius-sm);
}
.navbar-ledgerlane .nav-link:hover {
  color: var(--rm-nav-text) !important;
  background: rgba(255, 255, 255, 0.08);
}
.navbar-ledgerlane .navbar-text {
  color: rgba(248, 250, 252, 0.85) !important;
  font-size: 0.9rem;
}

/* Cards */
.card-ledgerlane {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  box-shadow: var(--rm-shadow);
  overflow: hidden;
}
.card-ledgerlane .card-header {
  background: transparent;
  border-bottom: 1px solid var(--rm-border);
  font-weight: 600;
  color: var(--rm-text);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}
.card-ledgerlane .card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn-ledgerlane-primary {
  background: var(--rm-accent);
  border-color: var(--rm-accent);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--rm-radius-sm);
}
.btn-ledgerlane-primary:hover {
  background: var(--rm-accent-hover);
  border-color: var(--rm-accent-hover);
  color: #fff;
}
.btn-ledgerlane-success {
  background: var(--rm-success);
  border-color: var(--rm-success);
  color: #fff;
  font-weight: 600;
  border-radius: var(--rm-radius-sm);
}
.btn-ledgerlane-success:hover {
  background: #047857;
  border-color: #047857;
  color: #fff;
}
.btn-outline-ledgerlane {
  border: 1px solid var(--rm-border);
  color: var(--rm-text);
  font-weight: 500;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
}
.btn-outline-ledgerlane:hover {
  background: var(--rm-bg);
  border-color: var(--rm-text-muted);
  color: var(--rm-text);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--rm-text);
  margin-bottom: 0.4rem;
}
.form-label + .form-control,
.form-label + .form-select {
  margin-top: 0;
}
.form-control,
.form-select {
  display: block;
  width: 100%;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--rm-text);
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control::placeholder {
  color: var(--rm-text-muted);
  opacity: 0.85;
}
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
  border-color: var(--rm-text-muted);
}
.form-control:focus,
.form-select:focus {
  outline: 0;
  border-color: var(--rm-accent);
  box-shadow: 0 0 0 3px var(--rm-accent-soft);
}
.form-control:disabled,
.form-select:disabled {
  background: var(--rm-bg);
  color: var(--rm-text-muted);
  cursor: not-allowed;
}
.form-control-sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}
.form-select option {
  padding: 0.25rem;
}
/* File input */
.form-control[type="file"] {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
.form-control[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rm-accent);
  background: var(--rm-accent-soft);
  border: 0;
  border-radius: var(--rm-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.form-control[type="file"]::file-selector-button:hover {
  background: rgba(13, 148, 136, 0.2);
}
/* Inline / filter forms */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.form-inline .form-control,
.form-inline .form-select {
  width: auto;
  min-width: 0;
}
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--rm-text-muted);
  margin-top: 0.35rem;
}
.form-upload .form-group {
  margin-bottom: 1.25rem;
}
.form-upload .form-group:last-of-type {
  margin-bottom: 1rem;
}
.form-upload .btn-link-sm {
  font-size: 0.85rem;
  color: var(--rm-accent);
  text-decoration: none;
  font-weight: 500;
}
.form-upload .btn-link-sm:hover {
  color: var(--rm-accent-hover);
  text-decoration: underline;
}
.form-upload-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}
.form-login-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* Alerts */
.alert {
  border-radius: var(--rm-radius-sm);
  border: none;
}
.alert-login-error {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--rm-radius-sm);
}
.alert-login-error .bi {
  flex-shrink: 0;
  font-size: 1.1rem;
}
.alert-success {
  display: flex;
  align-items: center;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.alert-success .bi {
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.breadcrumb-item a {
  color: var(--rm-text-muted);
  text-decoration: none;
}
.breadcrumb-item a:hover {
  color: var(--rm-accent);
}
.breadcrumb-item.active {
  color: var(--rm-text);
}

/* Page titles */
.page-title {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--rm-text);
  margin-bottom: 0.5rem;
}
.page-subtitle {
  color: var(--rm-text-muted);
  font-size: 0.95rem;
}

/* Session detail: header */
.session-header {
  padding-bottom: 0.25rem;
}
.session-period-range {
  font-size: 0.85rem;
}
.session-status-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-bg);
  color: var(--rm-text-muted);
  border: 1px solid var(--rm-border);
}

/* Session list (dashboard) */
.session-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--rm-text);
  border-bottom: 1px solid var(--rm-border);
  transition: background 0.15s ease;
}
.session-list-item:last-child {
  border-bottom: none;
}
.session-list-item:hover {
  background: var(--rm-bg);
  color: var(--rm-text);
}
.session-list-item .session-status {
  font-size: 0.8rem;
  color: var(--rm-text-muted);
  font-weight: 500;
}
.session-list-item .session-period {
  font-size: 0.8rem;
  color: var(--rm-text-muted);
  background: var(--rm-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

/* Upload cards */
.upload-card {
  border: 1px dashed var(--rm-border);
  border-radius: var(--rm-radius);
  background: var(--rm-surface);
  transition: border-color 0.2s, background 0.2s;
}
.upload-card:hover {
  border-color: var(--rm-accent);
  background: var(--rm-accent-soft);
}
.upload-card .upload-done {
  color: var(--rm-success);
  font-weight: 500;
  font-size: 0.9rem;
}
.upload-card .column-mapping-label {
  font-size: 0.8rem;
  color: var(--rm-text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

/* Tabs (results) */
.nav-tabs-ledgerlane {
  border-bottom: 1px solid var(--rm-border);
  gap: 0.25rem;
}
.nav-tabs-ledgerlane .nav-link {
  border: none;
  color: var(--rm-text-muted);
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: var(--rm-radius-sm);
  margin-bottom: -1px;
}
.nav-tabs-ledgerlane .nav-link:hover {
  color: var(--rm-text);
  background: var(--rm-bg);
}
.nav-tabs-ledgerlane .nav-link.active {
  color: var(--rm-accent);
  background: var(--rm-surface);
  border-bottom: 2px solid var(--rm-accent);
}

/* Tables */
.table-ledgerlane {
  margin: 0;
}
.table-ledgerlane thead th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rm-text-muted);
  border-bottom: 1px solid var(--rm-border);
  padding: 0.85rem 1rem;
  background: var(--rm-bg);
}
.table-ledgerlane tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--rm-border);
}
.table-ledgerlane tbody tr:last-child td {
  border-bottom: none;
}
.table-ledgerlane tbody tr:hover {
  background: var(--rm-bg);
}
.table-sort-link {
  color: var(--rm-text-muted);
  font-weight: 600;
}
.table-sort-link:hover {
  color: var(--rm-accent);
}
.table-toolbar {
  min-height: 2.75rem;
}

/* Login page: centered layout, use available space */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(60vh, 520px);
  width: 100%;
}
.login-page-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.login-card-wrapper {
  width: 100%;
}
.login-card-wrapper .card-ledgerlane .card-header .bi {
  font-size: 1.15rem;
  opacity: 0.9;
}
.input-group-phone .input-group-text {
  background: var(--rm-bg);
  border: 1px solid var(--rm-border);
  border-right: none;
  color: var(--rm-text-muted);
  font-weight: 500;
  border-radius: var(--rm-radius-sm) 0 0 var(--rm-radius-sm);
}
.input-group-phone .form-control {
  border-radius: 0 var(--rm-radius-sm) var(--rm-radius-sm) 0;
}
/* Password visibility toggle */
.password-toggle-wrapper {
  position: relative;
  display: block;
}
.password-toggle-wrapper .form-control {
  padding-right: 2.75rem;
}
.password-toggle-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.35rem 0.5rem;
  color: var(--rm-text-muted);
  cursor: pointer;
  border-radius: var(--rm-radius-sm);
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.password-toggle-btn:hover {
  color: var(--rm-text);
  background: var(--rm-bg);
}
.password-toggle-btn:focus {
  outline: 0;
  color: var(--rm-accent);
}
.password-toggle-btn i {
  font-size: 1.15rem;
  display: block;
}

.form-login .form-group {
  margin-bottom: 1.25rem;
}
.form-login .form-group:last-of-type {
  margin-bottom: 1rem;
}
.form-login .btn {
  margin-top: 0.25rem;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
}
.form-login .btn i {
  font-size: 1.1em;
}

/* Create session form */
.create-session-form .form-control {
  max-width: 320px;
}
.create-session-form .btn {
  border-radius: var(--rm-radius-sm);
  font-weight: 600;
}

/* Action bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Actions step: card grid */
.step-block-lead {
  font-size: 0.95rem;
  margin-bottom: 0;
}
.step-block-actions {
  max-width: 100%;
}
.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 576px) {
  .actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.action-card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 0;
}
.action-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.action-card:hover {
  border-color: var(--rm-text-muted);
  box-shadow: var(--rm-shadow);
}
.action-card-primary {
  border-color: var(--rm-accent);
  background: var(--rm-accent-soft);
}
.action-card-primary:hover {
  border-color: var(--rm-accent-hover);
}
.action-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-bg);
  color: var(--rm-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.action-card-primary .action-card-icon {
  background: var(--rm-accent);
  color: #fff;
}
.action-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--rm-text);
}
.action-card-desc {
  font-size: 0.875rem;
  color: var(--rm-text-muted);
  margin: 0;
  line-height: 1.45;
  flex: 1;
  min-height: 2.5rem;
}
/* Button row: same position in every card – fixed size, right-aligned, same top padding */
.action-card-form {
  margin-top: auto;
  padding-top: 0.75rem;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.action-card-body > .btn {
  margin-top: auto;
  padding-top: 0.75rem;
  align-self: flex-end;
}
.action-card .btn {
  width: 7rem;
  min-width: 7rem;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  line-height: 1;
  text-align: center;
}
/* Match <button> to <a>: reset browser/Bootstrap defaults so icon+text center like Results */
.action-card button.btn {
  font-family: inherit;
}
.action-card button.btn i {
  margin: 0;
  line-height: 1;
}
.action-card .btn i {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.action-card-form .btn {
  margin-top: 0;
  padding-top: 0;
}

/* Step back navigation */
.step-back-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.step-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rm-accent);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--rm-radius-sm);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.step-back-link:hover {
  color: var(--rm-accent-hover);
  background: var(--rm-accent-soft);
}
.step-back-link-secondary {
  color: var(--rm-text-muted);
}
.step-back-link-secondary:hover {
  color: var(--rm-text);
  background: var(--rm-bg);
}

/* Empty state */
.empty-state {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--rm-text-muted);
  font-size: 0.95rem;
}

/* Session detail: step flow */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}
.steps-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.steps-list-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--rm-border);
  color: var(--rm-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.steps-list-item-done .steps-list-num {
  background: var(--rm-border);
  color: var(--rm-text-muted);
}
.steps-list-label {
  font-weight: 500;
  color: var(--rm-text-muted);
  font-size: 0.9rem;
}
.steps-list-item-done .steps-list-label {
  color: var(--rm-text);
}
.steps-list-item-active .steps-list-num {
  background: var(--rm-accent);
  color: #fff;
}
.steps-list-item-active .steps-list-label {
  color: var(--rm-text);
  font-weight: 600;
}
.steps-list-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.steps-list-link:hover {
  color: inherit;
}
.steps-list-connector {
  width: 2rem;
  height: 2px;
  background: var(--rm-border);
  margin: 0 0.5rem;
}

.step-block {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.step-block-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.step-block-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--rm-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-block-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--rm-text);
}
.step-block-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rm-accent);
}

/* Mobile header (visible only on small screens) */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.25rem;
  background: var(--rm-nav-bg);
  color: var(--rm-nav-text);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1030;
  box-shadow: var(--rm-shadow);
}
.mobile-header-brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--rm-nav-text);
  text-decoration: none;
}
.mobile-header-brand:hover {
  color: var(--rm-nav-text);
  opacity: 0.9;
}
.mobile-header-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--rm-nav-text);
  border-radius: var(--rm-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.mobile-header-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.mobile-header-menu-btn .bi {
  font-size: 1.5rem;
}
.mobile-header-menu-btn .sidebar-open-show {
  display: none;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1020;
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.sidebar-open .sidebar-backdrop {
  display: block;
  opacity: 1;
}

/* Sidebar: responsive — drawer on mobile */
@media (max-width: 991px) {
  .mobile-header {
    display: flex;
  }
  .main-content {
    padding-top: 3.25rem;
  }
  .main-content-inner {
    padding: 1rem 1rem 1.5rem;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    min-width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 1025;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-brand {
    font-size: 1.15rem;
    padding: 1.25rem 1rem;
  }
}

/* Small phones */
@media (max-width: 575px) {
  .main-content-inner {
    padding: 0.75rem 0.75rem 1.25rem;
  }
  .page-title {
    font-size: 1.35rem;
  }
  .login-page {
    min-height: min(50vh, 400px);
    padding: 0 0.5rem;
  }
  .login-page-inner {
    padding: 0 0.25rem;
  }
}

/* Dashboard: create session form stacks on mobile */
@media (max-width: 575px) {
  .create-session-form {
    flex-direction: column;
    align-items: stretch;
  }
  .create-session-form .form-control {
    max-width: none;
    min-width: 0;
  }
  .create-session-form .btn {
    margin-left: 0;
    margin-top: 0;
  }
}

/* Session list item: stack title and delete on very small screens */
@media (max-width: 575px) {
  .session-list-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .session-list-item a {
    min-width: 0;
    flex: 1 1 100%;
  }
  .session-list-item .session-period {
    margin-top: 0.25rem;
  }
  .session-list-item form {
    flex-shrink: 0;
  }
}

/* Session detail: column mapping full width on small screens */
@media (max-width: 575px) {
  .step-block .row.g-2 .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Session header and steps: tighter on mobile */
@media (max-width: 575px) {
  .session-header {
    gap: 0.75rem;
  }
  .session-header-meta {
    gap: 0.5rem;
  }
  .steps-list {
    gap: 0.25rem;
  }
  .steps-list-connector {
    width: 1rem;
    margin: 0 0.25rem;
  }
  .steps-list-label {
    font-size: 0.85rem;
  }
}

/* Action cards: full width on mobile (already 1 col below 576px) */
@media (max-width: 575px) {
  .action-card .btn {
    width: auto;
    min-width: 0;
  }
}

/* Tables: ensure horizontal scroll on small screens */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 575px) {
  .table-ledgerlane thead th,
  .table-ledgerlane tbody td {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Alerts: wrap long text */
.alert {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Results filter form: stack on mobile */
@media (max-width: 575px) {
  .form-inline.mb-4 .form-control,
  .form-inline.mb-4 .form-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .form-inline.mb-4 .btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Pagination */
.pagination-ledgerlane {
  --bs-pagination-color: var(--rm-text);
  --bs-pagination-bg: var(--rm-surface);
  --bs-pagination-border-color: var(--rm-border);
  --bs-pagination-hover-color: var(--rm-accent);
  --bs-pagination-hover-bg: var(--rm-accent-soft);
  --bs-pagination-hover-border-color: var(--rm-border);
  --bs-pagination-active-bg: var(--rm-accent);
  --bs-pagination-active-border-color: var(--rm-accent);
  --bs-pagination-disabled-bg: var(--rm-surface);
  --bs-pagination-disabled-color: var(--rm-text-muted);
  gap: 0.2rem;
}
.pagination-ledgerlane .page-link {
  border-radius: var(--rm-radius-sm);
  padding: 0.4rem 0.75rem;
  font-weight: 500;
}
.pagination-ledgerlane .page-item.active .page-link {
  color: #fff;
}
.pagination-ledgerlane .page-link:hover {
  color: var(--rm-accent);
}
