
:root {
  /* Theme Colors - Orange Minimalist */
  --navy: #C96B2C;       /* Deep Burnt Orange */
  --blue: #E58A45;       /* Warm Orange */
  --sky: #FCEBDD;        /* Soft Peach */
  --ink: #3D3028;        /* Dark Warm Brown */
  --muted: #9B887A;      /* Warm Gray */
  --line: #F0DFD1;       /* Soft Beige Border */
  --bg: #FFF9F4;         /* Warm Cream Background */
  --white: #FFFFFF;      /* Clean White */
  --gold: #E9AD55;       /* Golden Orange */

  /* Additional Theme Colors */
  --teal: #E58A45;       /* Primary Orange */
  --mint: #F4B77E;       /* Light Orange */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

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

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

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #C96B2C 0%, #D97B38 65%, #E99A59 100%);
  color: #fff;
  padding: 26px 18px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--white);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: bold;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand small {
  display: block;
  color: #FFF0E3;
  font-size: 11px;
  letter-spacing: .5px;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #FFE1C9;
  padding: 12px 10px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav a {
  padding: 11px 13px;
  border-radius: 9px;
  color: #FFF3E9;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: background .2s, color .2s;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, .20);
  color: #fff;
}

.nav a span {
  font-size: 14px;
}

.sidebar-foot {
  margin-top: auto;
  color: #FFE1C9;
  font-size: 11px;
  padding: 20px 10px 0;
}

.main {
  min-width: 0;
  flex: 1;
  padding: 30px 38px 55px;
  max-width: 1500px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.topbar h2 {
  margin: 0;
  font-size: 19px;
  color: var(--navy);
}

.term {
  font-size: 12px;
  color: var(--muted);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: var(--teal);
  font-weight: bold;
}

.profile b {
  display: block;
  font-size: 13px;
}

.profile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.page-title {
  margin: 0;
  color: var(--navy);
  font-size: 29px;
  line-height: 1.3;
}

.sub {
  margin: 7px 0 24px;
  color: var(--muted);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 23px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(201, 107, 44, .045);
}

.card h3 {
  margin: 0 0 15px;
  color: var(--navy);
  font-size: 17px;
}

.card p {
  margin: 7px 0;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  padding: 20px;
  border-radius: 13px;
  background: var(--white);
  border: 1px solid var(--line);
}

.stat .number {
  font-size: 27px;
  font-weight: 700;
  color: var(--blue);
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  padding: 9px 15px;
  font: inherit;
  cursor: pointer;
  transition: background .2s;
}

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

.button.secondary {
  background: var(--sky);
  color: var(--navy);
}

.button.secondary:hover {
  background: #F5D8C0;
}

.muted {
  color: var(--muted);
}

.chapter-list {
  display: grid;
  gap: 10px;
}

.chapter {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}

.chapter-no {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--sky);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: bold;
}

.chapter h4 {
  margin: 0 0 3px;
  font-size: 14px;
}

.chapter p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}

.info-grid p {
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

ul {
  padding-left: 22px;
}

li {
  margin: 5px 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
  font-size: 13px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #FCEBDD;
  color: var(--navy);
  font-weight: 700;
}

input,
select {
  padding: 10px 12px;
  border: 1px solid #EBD4C2;
  border-radius: 8px;
  font: inherit;
  background: var(--white);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--mint);
  border-color: var(--teal);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.pill {
  display: inline-block;
  background: #FCEBDD;
  color: #C96B2C;
  padding: 3px 9px;
  border-radius: 30px;
  font-size: 11px;
}

.footer-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 18px;
}

.resource-link {
  color: var(--teal);
  text-decoration: underline;
}

.assignment {
  border-left: 4px solid var(--gold);
  padding: 3px 0 3px 15px;
  margin: 15px 0;
}

.assignment h4 {
  margin: 0 0 4px;
}

.tag {
  font-size: 11px;
  color: #96521F;
  background: #FFF0D9;
  border-radius: 20px;
  padding: 3px 8px;
}

@media(max-width:900px) {
  .sidebar {
    width: 220px;
  }

  .main {
    padding: 24px;
  }
}

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

  .sidebar {
    width: 100%;
    padding: 15px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    display: flex;
    overflow: auto;
  }

  .nav a {
    white-space: nowrap;
    padding: 8px 10px;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 20px 15px;
  }

  .topbar {
    align-items: flex-start;
  }

  .profile {
    display: none;
  }

  .two,
  .three,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 24px;
  }
}

/* ===== FIX PLO TABLE OVERFLOW ===== */

.card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.plo-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

#plo-table {
    display: table;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
    font-size: 14px;
}

#plo-table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    box-sizing: border-box;
    padding: 12px 10px;
    vertical-align: top;
}

#plo-table td:first-child {
    width: 75px !important;
    text-align: center;
}

#plo-table td:last-child {
    width: auto;
    line-height: 1.8;
}

/* Mobile */
@media (max-width: 700px) {
    .card {
        padding: 15px;
    }

    #plo-table {
        font-size: 13px;
    }

    #plo-table td:first-child {
        width: 60px !important;
    }
}

/* ===== MGT 2401 Orange Minimal refresh ===== */
:root {
  --navy: #C2410C;
  --blue: #F97316;
  --sky: #FFF1E6;
  --ink: #292524;
  --muted: #78716C;
  --line: #E7E5E4;
  --bg: #FAFAF9;
  --white: #FFFFFF;
  --gold: #FB923C;
  --teal: #EA580C;
  --mint: #FED7AA;
}
body { background: #FAFAF9; color: var(--ink); }
.sidebar {
  background: #FFFFFF;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand-icon { background: var(--sky); color: var(--navy); }
.brand small, .nav-label, .sidebar-foot { color: #A8A29E; }
.nav a { color: #57534E; border-radius: 8px; }
.nav a:hover, .nav a.active {
  background: #FFF1E6;
  color: #C2410C;
}
.topbar h2, .page-title, .card h3 { color: #C2410C; }
.card, .stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  background: #FFFFFF;
}
.stat .number { color: #EA580C; }
.button { background: #F97316; border-radius: 8px; }
.button:hover { background: #C2410C; }
.button.secondary { background: #FFF1E6; color: #C2410C; }
.button.secondary:hover { background: #FFEDD5; }
.chapter { border-color: var(--line); border-radius: 9px; }
.chapter-no { background: #FFF1E6; color: #C2410C; }
th { background: #FFF7ED; color: #9A3412; }
input, select { border-color: #D6D3D1; border-radius: 8px; }
input:focus, select:focus { outline: 2px solid #FED7AA; border-color: #F97316; }
.pill, .tag { background: #FFF1E6; color: #C2410C; }
.assignment { border-left-color: #F97316; }
.global-scores { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 24px; }
.global-score { padding:14px 16px; background:#fff; border:1px solid var(--line); border-radius:10px; min-width:0; }
.global-score b { display:block; color:#C2410C; font-size:20px; }
.global-score span { color:var(--muted); font-size:12px; }
.bar-row { display:grid; grid-template-columns:90px minmax(80px,1fr) 55px; gap:12px; align-items:center; margin:12px 0; }
.bar-track { height:9px; background:#F5F5F4; border-radius:20px; overflow:hidden; }
.bar-fill { height:100%; background:#F97316; border-radius:20px; }
.notice { background:#FFF7ED; border-left:3px solid #F97316; padding:12px 14px; border-radius:6px; }
@media(max-width:900px) { .global-scores { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) {
  .global-scores { grid-template-columns:1fr 1fr; }
  .bar-row { grid-template-columns:72px minmax(50px,1fr) 48px; gap:8px; }
}

/* ===== Orange Minimal Sidebar Navigation ===== */
.sidebar {
  background: #F97316;
  color: #FFFFFF;
  border-right: 1px solid #EA580C;
  box-shadow: none;
}

.brand-icon {
  background: #FFFFFF;
  color: #C2410C;
}

.brand strong {
  color: #FFFFFF;
}

.brand small,
.nav-label,
.sidebar-foot {
  color: #FFEDD5;
}

.nav a {
  color: #FFF7ED;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease;
}

.nav a:hover,
.nav a.active {
  background: #FFFFFF;
  color: #C2410C;
}

@media (max-width: 700px) {
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #EA580C;
  }

  .nav a:hover,
  .nav a.active {
    background: #FFFFFF;
    color: #C2410C;
  }
}
