@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --fd-ink: #1f2b40;
  --fd-muted: #5e6a82;
  --fd-bg: #f4f7fb;
  --fd-surface: #ffffff;
  --fd-border: #dbe3f0;
  --fd-primary: #0f6f89;
  --fd-primary-hover: #0b5f75;
  --fd-shadow-soft: 0 10px 26px rgba(22, 38, 63, 0.08);
  --fd-topbar-height: 64px;

  --bs-primary: #0f6f89;
  --bs-primary-rgb: 15, 111, 137;
  --bs-link-color: #0f6f89;
  --bs-link-hover-color: #0b5f75;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--fd-ink);
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 189, 126, 0.12), transparent 34%),
    radial-gradient(circle at 8% 10%, rgba(17, 137, 149, 0.09), transparent 38%),
    var(--fd-bg);
}

.app-main-shell {
  min-height: calc(100vh - var(--fd-topbar-height));
}

.app-topbar {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: var(--fd-topbar-height);
  z-index: 1030;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(5px);
  border-color: #d8e1ef !important;
}

.app-shell {
  min-height: calc(100vh - var(--fd-topbar-height));
}

.app-topbar .dropdown {
  position: relative;
  z-index: 1040;
}

.app-topbar .dropdown-menu {
  z-index: 1060;
}

.app-topbar-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.app-topbar-logo {
  height: 30px;
  width: auto;
  display: block;
}

.app-content-shell {
  animation: content-fade-in 420ms ease-out;
}

.app-content-shell > * {
  animation: content-fade-in 460ms ease-out;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.01em;
  font-weight: 700;
}

p, .text-muted, .small {
  color: var(--fd-muted) !important;
}

.card {
  border: 1px solid var(--fd-border);
  border-radius: 14px;
  box-shadow: var(--fd-shadow-soft);
}

.card-header {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-bottom: 1px solid var(--fd-border);
  font-weight: 700;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #f7faff;
  --bs-table-border-color: #d9e2ef;
}

.table thead th {
  color: #46536e;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.76rem;
}

.form-control,
.form-select,
.input-group-text {
  border-color: #ccd8ea;
  border-radius: 10px;
}

.form-control,
.form-select {
  background: #fcfdff;
}

.form-control:focus,
.form-select:focus {
  border-color: #8bbfca;
  box-shadow: 0 0 0 0.2rem rgba(15, 111, 137, 0.18);
  background: #fff;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--fd-primary);
  border-color: var(--fd-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--fd-primary-hover) !important;
  border-color: var(--fd-primary-hover) !important;
}

.btn-outline-primary {
  color: #0f6f89;
  border-color: #72aebf;
}

.btn-outline-primary:hover {
  background: #0f6f89;
  border-color: #0f6f89;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.alert {
  border-radius: 12px;
  border: 0;
  box-shadow: 0 8px 20px rgba(26, 45, 75, 0.08);
}

.api-error-banner {
  border: 1px solid #f4d27a;
  background: linear-gradient(180deg, #fff7df 0%, #fff2cc 100%);
  color: #6b4f00;
}

.api-error-banner .api-retry-btn {
  white-space: nowrap;
}

.table-action-btn {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.table-action-btn i {
  font-size: 0.95rem;
}

.table td .table-action-btn + .table-action-btn {
  margin-left: 0.25rem;
}
#wrapper {
    display: flex;
}

#sidebar-wrapper {
    min-width: 250px;
    max-width: 250px;
  transition: all 0.3s;
}

#wrapper.toggled #sidebar-wrapper {
  margin-left: -250px;
}

.sidebar-section {
    padding: 10px 15px;
    font-size: 12px;
    text-transform: uppercase;
    color: #bbb;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: #495057 !important;
}

.sidebar-module-toggle {
  border: 0;
  border-radius: 8px;
  margin: 10px 10px 6px;
  padding: 8px 10px;
  font-weight: 600;
  background-color: #20293a !important;
  color: #cfd7e6 !important;
  border-left: 3px solid #3d4a63;
}

.sidebar-module-toggle:hover {
  background-color: #27344b !important;
  color: #fff !important;
}

.sidebar-module-toggle .bi-chevron-down {
  transition: transform 0.2s ease;
}

.sidebar-module-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.sidebar-module-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.sidebar-module-name {
  font-size: 0.9rem;
  color: #e8eefb;
}

.sidebar-submenu {
  margin: 0 10px 4px;
  border-left: 2px solid #3a465f;
}

.sidebar-root-item {
  margin: 10px;
  border-radius: 8px;
  font-weight: 600;
}

.sidebar-subitem {
  padding: 8px 10px 8px 14px;
  font-size: 0.88rem;
  border: 0;
  border-radius: 0 8px 8px 0;
  background-color: #172033 !important;
  color: #d7dfef !important;
}

.sidebar-subitem:hover {
  background-color: #22304a !important;
}

#sidebar-wrapper .list-group-item.active {
  background-color: #0d6efd !important;
  color: #fff !important;
  border-color: #0d6efd !important;
}

#sidebar-wrapper .list-group-item.active:hover {
  background-color: #0b5ed7 !important;
}
/* Sidebar fixed height */
#sidebar-wrapper {
    width: 250px;
  height: calc(100vh - var(--fd-topbar-height));
    position: sticky; /* Stay fixed while body scrolls */
  top: var(--fd-topbar-height);
    display: flex;
    flex-direction: column;
}

/* Only menu scrolls */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

    /* Optional scrollbar styling */
    .sidebar-menu::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background-color: #6c757d;
        border-radius: 4px;
    }
.punch-section {
    flex-shrink: 0;
    background: #111827;
}

/* Dashboard rich UI */
.dashboard-shell {
  --dash-bg: #f5f8ff;
  --dash-ink: #1d2433;
  --dash-muted: #5a6479;
  --dash-border: #dce4f3;
  --dash-surface: #ffffff;
  --dash-accent: #0c7c89;
  --dash-accent-soft: #d8f2f5;
  --dash-shadow: 0 16px 34px rgba(29, 36, 51, 0.08);
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--dash-ink);
}

.dashboard-hero {
  background:
    radial-gradient(circle at 95% 20%, rgba(255, 182, 116, 0.3), transparent 34%),
    radial-gradient(circle at 16% 82%, rgba(19, 145, 156, 0.24), transparent 40%),
    linear-gradient(135deg, #f9fbff 0%, #eef5ff 100%);
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow);
  position: relative;
  animation: dashboard-rise 500ms ease-out;
}

.dashboard-eyebrow {
  color: #0a6670;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.dashboard-title {
  font-weight: 800;
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  line-height: 1.1;
  margin: 0;
}

.dashboard-subtitle {
  color: var(--dash-muted);
  max-width: 62ch;
}

.dashboard-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: var(--dash-accent-soft);
  color: #0d5961;
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-timestamp-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(12, 124, 137, 0.25);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.dashboard-timestamp-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--dash-muted);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.dashboard-timestamp-value {
  font-size: 1.2rem;
  font-weight: 800;
}

.dashboard-timestamp-meta {
  color: #4f5a70;
  font-weight: 600;
}

.dashboard-mini-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #3d485f;
  font-size: 0.83rem;
}

.dashboard-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-dot.is-on {
  background: #22a06b;
  box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.18);
}

.dashboard-dot.is-off {
  background: #cf4f5e;
  box-shadow: 0 0 0 4px rgba(207, 79, 94, 0.14);
}

.dashboard-status-alert {
  border: 0;
  box-shadow: 0 8px 22px rgba(35, 141, 94, 0.12);
}

.dashboard-panel {
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow);
  animation: dashboard-rise 520ms ease-out;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.62rem;
}

.chip-positive {
  background: #d7f6e7;
  color: #136440;
}

.chip-neutral {
  background: #f3f4f8;
  color: #4f5b72;
}

.dashboard-meta-grid {
  display: grid;
  gap: 0.65rem 1.3rem;
  grid-template-columns: repeat(3, minmax(130px, auto));
}

.dashboard-meta-label {
  color: var(--dash-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.dashboard-meta-value {
  font-weight: 700;
}

.dashboard-meta-sub {
  color: #2e3950;
  font-weight: 600;
}

.dashboard-section-head {
  margin-bottom: 0.7rem;
}

.dashboard-section-head h6 {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #5f6981;
  font-weight: 800;
}

.dashboard-stat-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 1rem 1.1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 28px rgba(24, 38, 63, 0.2);
  animation: dashboard-rise 540ms ease-out;
}

.dashboard-stat-label {
  font-size: 0.84rem;
  opacity: 0.92;
  font-weight: 700;
}

.dashboard-stat-value {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.06;
  font-weight: 800;
}

.dashboard-stat-icon {
  font-size: 1.7rem;
  opacity: 0.9;
}

.stat-ocean {
  background: linear-gradient(130deg, #0066a6 0%, #1f8dd6 100%);
}

.stat-amber {
  background: linear-gradient(130deg, #ca6a00 0%, #f59f27 100%);
}

.stat-crimson {
  background: linear-gradient(130deg, #9a2342 0%, #d94362 100%);
}

.stat-emerald {
  background: linear-gradient(130deg, #19784f 0%, #2ba676 100%);
}

.stat-cyan {
  background: linear-gradient(130deg, #0f6f89 0%, #1ea5c8 100%);
}

.stat-slate {
  background: linear-gradient(130deg, #43526f 0%, #5c6e93 100%);
}

.dashboard-action-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.dashboard-action-card {
  border: 1px solid #d6deef;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  color: #22304b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-action-card i {
  color: #0f6f89;
  font-size: 1.05rem;
}

.dashboard-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(20, 42, 75, 0.14);
  border-color: #a6c4ea;
  color: #14253e;
}

.dashboard-action-card.client-action i {
  color: #b26b00;
}

.dashboard-stagger-row > div:nth-child(2) .dashboard-stat-card {
  animation-delay: 80ms;
}

.dashboard-stagger-row > div:nth-child(3) .dashboard-stat-card {
  animation-delay: 160ms;
}

@keyframes dashboard-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991.98px) {
  .dashboard-meta-grid {
    grid-template-columns: repeat(2, minmax(130px, auto));
  }
}

@media (max-width: 575.98px) {
  .dashboard-meta-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes content-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}