:root {
  --navy: #1e2a4a;
  --navy-light: #26365c;
  --gold: #c9a227;
  --green: #2c7a5b;
  --green-bg: #e9f3ee;
  --red: #b3413a;
  --red-bg: #fbeceb;
  --text: #1e2a3a;
  --muted: #6b7280;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e1e6ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Calibri, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

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

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 240px;
  background: var(--navy);
  color: #e4e9f2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.sidebar .brand {
  padding: 0 22px 22px 22px;
  border-bottom: 1px solid #33436a;
  margin-bottom: 16px;
}
.sidebar .brand .school {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  font-family: Cambria, Georgia, serif;
  line-height: 1.3;
}
.sidebar .brand .system {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-top: 4px;
  text-transform: uppercase;
}
.sidebar nav { flex: 1; }
.sidebar nav .section-label {
  padding: 14px 22px 6px 22px;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #7f8cae;
}
.sidebar nav a {
  display: block;
  padding: 10px 22px;
  color: #cdd6e6;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #26365c; color: #fff; }
.sidebar nav a.active {
  background: #26365c;
  color: #fff;
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar .userbox {
  padding: 16px 22px 0 22px;
  border-top: 1px solid #33436a;
  margin-top: 12px;
}
.sidebar .userbox .uname { color: #fff; font-weight: 600; font-size: 13.5px; }
.sidebar .userbox .urole {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.sidebar .userbox form { margin-top: 10px; }
.sidebar .userbox button {
  background: none;
  border: 1px solid #445581;
  color: #cdd6e6;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  width: 100%;
}
.sidebar .userbox button:hover { background: #33436a; }

/* ---------------- Main content ---------------- */
.main { flex: 1; min-width: 0; padding: 28px 34px 60px 34px; }

.page-header { margin-bottom: 22px; }
.page-header .kicker {
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.page-header h1 {
  font-family: Cambria, Georgia, serif;
  color: var(--navy);
  font-size: 26px;
  margin: 4px 0 6px 0;
}
.page-header p.sub { color: var(--muted); margin: 0; font-size: 14px; }
.page-header-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* ---------------- Cards / stats ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 18px 20px;
  border: 1px solid var(--border);
}
.stat-card .label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.stat-card .value {
  font-family: Cambria, Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.stat-card .value.gold { color: #a3811d; }
.stat-card .value.green { color: var(--green); }
.stat-card .footnote { font-size: 12px; color: var(--muted); margin-top: 6px; }

.card {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.card h2 {
  font-family: Cambria, Georgia, serif;
  font-size: 17px;
  color: var(--navy);
  margin: 0 0 14px 0;
}
.card h3 {
  font-family: Cambria, Georgia, serif;
  font-size: 15px;
  color: var(--navy);
  margin: 18px 0 10px 0;
}

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.7px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
}
tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.total-row td { font-weight: 700; border-top: 2px solid var(--border); background: #fafbfd; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending { background: #fbf3df; color: #8a6d1a; }
.badge-approved, .badge-active, .badge-received { background: var(--green-bg); color: var(--green); }
.badge-rejected, .badge-disposed { background: var(--red-bg); color: var(--red); }
.badge-ordered { background: #e6edf7; color: #33507d; }
.badge-navy { background: #e6edf7; color: var(--navy); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid.single { grid-template-columns: 1fr; }
.field { margin-bottom: 4px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cfd6e2;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,42,74,0.08);
}
.form-actions { margin-top: 22px; display: flex; gap: 10px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #16213b; }
.btn-gold { background: var(--gold); color: #3a2f08; }
.btn-gold:hover { background: #b3911f; }
.btn-outline { background: #fff; border: 1px solid #cfd6e2; color: var(--text); }
.btn-outline:hover { background: #f4f6f9; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #922f29; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-green { background: var(--green); color: #fff; }

/* ---------------- Alerts ---------------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid #f0c9c6; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bfe3d3; }
.alert-warn { background: #fbf3df; color: #8a6d1a; border: 1px solid #eeddad; }
.alert-info { background: #e9eff8; color: #2c4066; border: 1px solid #cad9ef; }

/* ---------------- Misc ---------------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.flow-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.flow-steps .step {
  background: #f4f6f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.flow-steps .step.done { background: var(--green-bg); color: var(--green); border-color: #bfe3d3; }
.flow-steps .arrow { color: #b7c0cf; align-self: center; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(circle at 85% 10%, #26365c 0%, var(--navy) 45%);
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 40px 38px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-box .kicker { color: var(--gold); font-size: 11.5px; letter-spacing: 1.5px; font-weight: 700; text-transform: uppercase; }
.login-box h1 { font-family: Cambria, Georgia, serif; color: var(--navy); font-size: 22px; margin: 8px 0 4px 0; }
.login-box p.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px 0; }
.login-box .field { margin-bottom: 16px; }
.demo-creds {
  margin-top: 22px;
  padding: 12px 14px;
  background: #f4f6f9;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}






/* =========================================================
   FADA AMS — RESPONSIVE APPLICATION SIDEBAR
   ========================================================= */

:root {
  --sidebar-width: 260px;
  --sidebar-navy: #10243a;
  --sidebar-navy-deep: #0b1b2b;
  --sidebar-gold: #b89443;
  --sidebar-text: #8d9bab;
  --sidebar-muted: #657587;
  --sidebar-line: rgba(255,255,255,.07);
}


/* =========================================================
   APP SHELL
   ========================================================= */

.app-shell {
  min-height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  z-index: 1000;

  width: var(--sidebar-width);

  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      #10243a 0%,
      #0d2033 100%
    );

  color: #ffffff;

  border-right: 1px solid rgba(255,255,255,.05);

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}


/* =========================================================
   BRAND
   ========================================================= */

.sidebar .brand {
  padding: 28px 24px 25px;

  border-bottom: 1px solid var(--sidebar-line);
}

.sidebar .school {
  color: #ffffff;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 18px;

  font-weight: 400;

  line-height: 1.25;

  letter-spacing: -.3px;
}

.sidebar .system {
  margin-top: 7px;

  color: #8191a2;

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 1.7px;

  text-transform: uppercase;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.sidebar-nav {
  flex: 1;

  padding: 20px 12px 24px;
}

.sidebar .section-label {
  margin: 22px 12px 8px;

  color: #647689;

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 1.7px;

  text-transform: uppercase;
}

.sidebar .section-label:first-child {
  margin-top: 0;
}


/* =========================================================
   NAV LINKS
   ========================================================= */

.sidebar-nav a {
  position: relative;

  min-height: 40px;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  margin: 2px 0;

  border-radius: 5px;

  color: var(--sidebar-text);

  font-size: 12px;

  font-weight: 600;

  text-decoration: none;

  transition:
    background .18s ease,
    color .18s ease,
    transform .18s ease;
}


.sidebar-nav a:hover {
  color: #ffffff;

  background: rgba(255,255,255,.055);
}


.sidebar-nav a.active {
  color: #ffffff;

  background: rgba(184,148,67,.12);
}


.sidebar-nav a.active::before {
  content: "";

  position: absolute;

  left: 0;

  top: 8px;
  bottom: 8px;

  width: 2px;

  background: var(--sidebar-gold);

  border-radius: 2px;
}


.nav-icon {
  width: 20px;

  flex: 0 0 20px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  color: #6f8294;

  font-size: 13px;

  line-height: 1;
}


.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
  color: var(--sidebar-gold);
}


/* =========================================================
   USER BOX
   ========================================================= */

.sidebar .userbox {
  flex-shrink: 0;

  padding: 18px 18px 20px;

  border-top: 1px solid var(--sidebar-line);

  background: rgba(0,0,0,.10);
}


.userbox-identity {
  display: flex;

  align-items: center;

  gap: 11px;

  min-width: 0;
}


.user-avatar {
  width: 32px;
  height: 32px;

  flex: 0 0 32px;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid rgba(184,148,67,.45);

  color: #d0b56f;

  font-size: 11px;

  font-weight: 800;
}


.sidebar .uname {
  max-width: 165px;

  overflow: hidden;

  color: #ffffff;

  font-size: 11px;

  font-weight: 700;

  white-space: nowrap;

  text-overflow: ellipsis;
}


.sidebar .urole {
  margin-top: 3px;

  color: #718397;

  font-size: 8px;

  font-weight: 800;

  letter-spacing: 1.1px;

  text-transform: uppercase;
}


.sidebar .userbox form {
  margin-top: 15px;
}


.sidebar .userbox button {
  width: 100%;

  padding: 8px 10px;

  border: 1px solid rgba(255,255,255,.09);

  border-radius: 4px;

  background: transparent;

  color: #8b9aaa;

  font-size: 10px;

  font-weight: 700;

  cursor: pointer;

  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease;
}


.sidebar .userbox button:hover {
  border-color: rgba(184,148,67,.35);

  background: rgba(184,148,67,.08);

  color: #ffffff;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.app-shell > .main {
  min-height: 100vh;

  margin-left: var(--sidebar-width);
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

.mobile-app-header {
  display: none;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.sidebar-overlay {
  display: none;
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 900px) {

  .mobile-app-header {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    z-index: 900;

    height: 64px;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 0 18px;

    background: #ffffff;

    border-bottom: 1px solid #e5e9ee;

    box-shadow:
      0 4px 18px rgba(16,36,58,.05);
  }


  .sidebar-toggle {
    position: relative;

    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 0;

    border: 0;

    border-radius: 5px;

    background: transparent;

    cursor: pointer;
  }


  .sidebar-toggle:hover {
    background: #f3f5f7;
  }


  .sidebar-toggle span {
    display: block;

    width: 20px;
    height: 2px;

    background: var(--sidebar-navy);

    transition:
      transform .2s ease,
      opacity .2s ease;
  }


  .sidebar-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }


  .sidebar-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }


  .sidebar-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }


  .mobile-app-brand {
    min-width: 0;

    display: flex;

    flex-direction: column;
  }


  .mobile-app-brand strong {
    overflow: hidden;

    color: var(--sidebar-navy);

    font-size: 12px;

    font-weight: 800;

    white-space: nowrap;

    text-overflow: ellipsis;
  }


  .mobile-app-brand span {
    margin-top: 2px;

    color: #7c8996;

    font-size: 8px;

    font-weight: 700;

    letter-spacing: 1px;

    text-transform: uppercase;
  }


  /* SIDEBAR DRAWER */

  .sidebar {
    width: min(280px, 84vw);

    transform: translateX(-100%);

    transition:
      transform .25s cubic-bezier(.4,0,.2,1);

    box-shadow:
      12px 0 40px rgba(0,0,0,.18);
  }


  .sidebar.is-open {
    transform: translateX(0);
  }


  /* OVERLAY */

  .sidebar-overlay {
    position: fixed;

    inset: 0;

    z-index: 950;

    display: block;

    background: rgba(7,20,32,.45);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
      opacity .25s ease,
      visibility .25s ease;
  }


  .sidebar-overlay.is-visible {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
  }


  /* MAIN */

  .app-shell > .main {
    margin-left: 0;

    padding-top: 64px;
  }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

  .mobile-app-header {
    height: 60px;

    padding: 0 14px;
  }


  .app-shell > .main {
    padding-top: 60px;
  }


  .sidebar {
    width: min(290px, 88vw);
  }


  .sidebar .brand {
    padding:
      24px
      20px
      22px;
  }


  .sidebar-nav {
    padding:
      17px
      10px
      20px;
  }


  .sidebar .userbox {
    padding:
      16px;
  }

}


/* =========================================================
   FADA AMS — MOBILE SIDEBAR CONTROL
   ========================================================= */

.sidebar-toggle {
    display: none;

    position: fixed;

    top: 18px;
    right: 18px;

    z-index: 1200;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 1px solid #dfe4e9;

    background: #ffffff;

    cursor: pointer;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 5px;

    box-shadow:
        0 8px 24px rgba(16, 36, 58, .08);
}


.sidebar-toggle span {
    display: block;

    width: 19px;
    height: 1px;

    background: #10243a;

    transition:
        transform 180ms ease,
        opacity 180ms ease;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 1090;

    background: rgba(16, 36, 58, .32);

    opacity: 0;

    pointer-events: none;

    transition: opacity 200ms ease;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    .sidebar-toggle {
        display: flex;
    }


    .sidebar {

        position: fixed;

        top: 0;
        left: 0;

        width: min(310px, 86vw);

        height: 100vh;

        z-index: 1100;

        overflow-y: auto;

        transform: translateX(-105%);

        transition:
            transform 240ms cubic-bezier(.22,.61,.36,1);

        box-shadow:
            18px 0 50px rgba(16,36,58,.14);
    }


    .sidebar.is-open {
        transform: translateX(0);
    }


    .sidebar-overlay {
        display: block;
    }


    .sidebar-overlay.is-visible {
        opacity: 1;

        pointer-events: auto;
    }


    /* HAMBURGER → X */

    .sidebar-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }


    .sidebar-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }


    .sidebar-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }


    body.sidebar-open {
        overflow: hidden;
    }


    /* Make the main content occupy the full screen */

    .main {
        margin-left: 0 !important;

        width: 100%;
    }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 600px) {

    .sidebar-toggle {
        top: 15px;
        right: 15px;

        width: 42px;
        height: 42px;
    }


    .sidebar {
        width: min(290px, 88vw);
    }

}