
:root {
  --navy: #071b33;
  --navy-light: #102b4c;
  --orange: #f28c28;
  --background: #f4f6fa;
  --white: #ffffff;
  --text: #25364a;
  --muted: #8290a2;
  --border: #e8edf3;
  --green: #15966a;
  --yellow: #e6a126;
  --shadow: 0 5px 24px rgba(16, 43, 76, .06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.app-body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */

.app-sidebar {
  width: 265px;
  min-width: 265px;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  padding: 25px 17px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  min-height: 105px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 12px 25px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 30px;
}

.sidebar-brand img {
  width: 175px;
  max-height: 65px;
  object-fit: contain;
  object-position: left center;
  background: white;
  border-radius: 5px;
  padding: 5px;
}

.sidebar-brand span {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-top: 10px;
}

.sidebar-label {
  padding: 0 13px;
  margin: 18px 0 12px;
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 800;
  color: #8395aa;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: #c5d0de;
  padding: 13px 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}

.nav-link span {
  width: 22px;
  font-size: 19px;
  text-align: center;
}

.nav-link:hover {
  background: rgba(255,255,255,.08);
  color: white;
}

.nav-link.active {
  background: var(--orange);
  color: white;
  box-shadow: 0 5px 15px rgba(242,140,40,.2);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 20px 8px 5px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar,
.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 12px;
}

.sidebar-bottom strong,
.sidebar-bottom small {
  display: block;
}

.sidebar-bottom strong {
  font-size: 12px;
}

.sidebar-bottom small {
  font-size: 10px;
  color: #9eafc1;
  margin-top: 4px;
}

/* MAIN AREA */

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: 90px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
}

.topbar-caption {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 800;
}

.app-topbar h1 {
  color: var(--navy);
  font-size: 23px;
  margin-top: 5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.system-status {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 6px;
}

.topbar-avatar {
  background: var(--navy);
}

/* CONTENT */

.app-content {
  flex: 1;
  padding: 32px 38px;
  width: 100%;
  max-width: 1700px;
  margin: 0 auto;
}

.app-page {
  display: none;
  animation: appear .25s ease;
}

.app-page.active {
  display: block;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* WELCOME */

.welcome-panel {
  background: linear-gradient(115deg, #071b33, #173d63);
  color: white;
  min-height: 205px;
  padding: 35px 40px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 35px;
}

.welcome-panel > div:first-child {
  position: relative;
  z-index: 1;
}

.welcome-label {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
}

.welcome-panel h2 {
  font-size: clamp(21px, 3vw, 31px);
  margin: 14px 0 10px;
  line-height: 1.25;
}

.welcome-panel p {
  color: #d0dce8;
  font-size: 13px;
  max-width: 570px;
  line-height: 1.7;
}

.welcome-decoration {
  font-size: 105px;
  font-weight: 900;
  color: rgba(255,255,255,.07);
  transform: rotate(-12deg);
  user-select: none;
}

/* SECTION HEADINGS */

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 20px;
}

.section-heading h2 {
  color: var(--navy);
  font-size: 19px;
  margin-bottom: 6px;
}

.section-heading p {
  color: var(--muted);
  font-size: 12px;
}

/* STATISTICS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 35px;
}

.stat-card {
  background: white;
  padding: 23px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 18px;
}

.stat-icon.blue {
  background: #e9f0fb;
  color: #3976bd;
}

.stat-icon.orange {
  background: #fff0e3;
  color: #e8872d;
}

.stat-icon.yellow {
  background: #fff6df;
  color: #d39a20;
}

.stat-icon.green {
  background: #e5f6ee;
  color: #15966a;
}

.stat-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-card > strong {
  display: block;
  color: var(--navy);
  font-size: 29px;
  margin: 5px 0;
}

.stat-card > small {
  color: #9aa6b5;
  font-size: 10px;
}

/* DASHBOARD PANELS */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 25px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h3 {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 5px;
}

.panel-heading p {
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  padding: 55px 15px;
  text-align: center;
}

.empty-state.compact {
  padding: 55px 10px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 17px;
  background: #f0f3f8;
  color: #8091a6;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 23px;
}

.empty-state h3 {
  color: var(--navy);
  font-size: 14px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* BUTTONS */

.primary-button {
  background: var(--orange);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 800;
  transition: .2s;
}

.primary-button:hover {
  background: #dc7415;
  transform: translateY(-1px);
}

.text-button {
  background: transparent;
  color: #d8791e;
  border: 0;
  font-size: 11px;
  font-weight: 800;
}

.text-button:hover {
  color: var(--navy);
}

/* FILTERS */

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-bar input,
.filter-bar select {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: white;
  font-size: 12px;
  outline: none;
}

.filter-bar input {
  flex: 1;
  min-width: 200px;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--orange);
}

/* FOOTER */

.app-footer {
  padding: 20px 38px;
  border-top: 1px solid var(--border);
  background: white;
  color: #9aa6b5;
  font-size: 10px;
  text-align: center;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .app-sidebar {
    width: 225px;
    min-width: 225px;
  }

  .app-content {
    padding: 25px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 15px;
  }

  .sidebar-brand {
    min-height: 65px;
    padding: 0 5px 12px;
    margin-bottom: 12px;
  }

  .sidebar-brand img {
    width: 145px;
    max-height: 48px;
  }

  .sidebar-label {
    margin: 12px 0 8px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .nav-link {
    padding: 11px 8px;
    font-size: 11px;
    gap: 7px;
  }

  .nav-link span {
    font-size: 16px;
    width: 18px;
  }

  .sidebar-bottom {
    display: none;
  }

  .app-topbar {
    height: 75px;
    padding: 0 18px;
  }

  .app-topbar h1 {
    font-size: 19px;
  }

  .system-status {
    display: none;
  }

  .app-content {
    padding: 20px 15px;
  }

  .welcome-panel {
    min-height: 185px;
    padding: 25px;
  }

  .welcome-decoration {
    display: none;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card > strong {
    font-size: 24px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel {
    padding: 17px;
  }

  .app-footer {
    padding: 18px 12px;
  }
}

@media (max-width: 380px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100%;
  }
}
