/* 
  ==============================
  SHARED APP FRAME (Assignments)
  ==============================
  - Base page layout
  - Navbar
  - Global headers
  - Utility classes
  - System settings button + modal
*/

:root {
    --bg: #ffffff;
    --text: #111111;
    --panel: rgb(141, 157, 141);
    --border: rgb(3, 46, 8);
    --surface: #ffffff;
    --nav-width: 180px;
    --content-max: 1280px;
    --content-pad: 24px;
    --pie-size: 160px;
}

/* MAIN BODY */
html, body {
    text-align: center;
    display: flex;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overscroll-behavior: none;
    width: 100%;
    font-family: "Manrope";
}

.content {
    text-align: center;
    flex: 1;
    padding: var(--content-pad);
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    box-sizing: border-box;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* NAVBAR */
.navbar {
    width: 180px;
    border-right: 1px solid #ddd;
    padding: 16px;
    text-align: left;
    transition: width 0.24s ease, padding 0.24s ease;
}

.navbar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    font-family: "Noto Sans";
    gap: 12px;
    padding: 0;
    margin-top: 16px;
    font-size: 20px;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease, margin-top 0.2s ease;
}

.navbar a {
    border-radius: 6px;
    display: block;
    width: 100%;
    text-decoration: none;
    color: black;
}

.navbar a:hover {
    background: rgba(4, 255, 0, 0.742);
}

.navbar a.active {
    background: rgba(124, 255, 122, 0.66);
    font-weight: 700;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 70px;
    cursor: pointer;
    margin-bottom: 10px;
    margin-left: 50px;
    text-align: center;
    transition: margin-left 0.24s ease;
}

body.nav-collapsed .navbar {
    width: 72px;
    padding: 16px 10px;
    overflow: hidden;
}

body.nav-collapsed .navbar ul {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-12px);
    margin-top: 0;
    height: 0;
}

body.nav-collapsed .menu-toggle {
    margin-left: 0;
}

/* ----- HEADERS STYLING ----- */
h1 {
    color: black;
    font-family: "Manrope";
    font-size: 36px;
    font-weight: 700;
}

h2 {
    color: black;
    font-family: "Manrope";
    font-size: 28px;
    font-weight: 600;
}

/* UTIL */
.hidden { display: none; }

/* SYSTEM SETTINGS BUTTON */
.system-settings {
    position: fixed;
    bottom: 50px;
    left: 50px;
    transition: transform 0.24s ease, opacity 0.2s ease;
}

body.nav-collapsed .system-settings {
    transform: translateX(-120px);
    opacity: 0;
    pointer-events: none;
}

#system-settings-btn {
    appearance: none;
    background: transparent;
    font-size: 40px;
    align-self: center;
    justify-self: center;
    border: none;
    cursor: pointer;
}

#system-settings-btn:hover {
    transition: transform 0.3s ease, filter 0.3s ease;
    transform: scale(1.15) rotate(8deg);
    filter: brightness(1.05);
}

#system-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    font-family: "Noto Sans";
    background: white;
    border-radius: 12px;
    padding: 0;
    border: 1px solid #ddd;
    z-index: 900;
    text-align: left;
    overflow: hidden;
}

.settings-panel p {
    margin-left: 10px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    min-height: 240px;
    margin-top: 12px;
}

.settings-sidebar {
    border-right: 1px solid #ddd;
    padding: 12px;
    background: #f7f7f7;
}

.settings-sidebar-title {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
}

.settings-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.settings-nav {
    width: 100%;
    text-align: left;
    border: 1px solid #ccc;
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.settings-nav:hover {
    transform: scale(1.03);
    filter: brightness(1.02);
}

.settings-nav.active {
    border-color: #111;
    font-weight: 700;
}

.settings-header {
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.settings-title {
    margin: 5px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
}

.settings-subtitle {
    margin-top: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.85;
}

.settings-panel.hidden { display: none; }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.setting-labels { text-align: left; margin-left: 10px; }
.setting-name { font-weight: 700; }
.setting-desc { font-size: 12px; opacity: 0.75; margin-top: 2px; }

.setting-action-btn {
    min-width: 84px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-right: 10px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.setting-action-btn:hover {
    transform: scale(1.03);
    filter: brightness(1.04);
}

.setting-action-btn.danger {
    background: #d84c4c;
    border-color: #b63b3b;
}

.setting-action-btn.success {
    background: #2f9a4a;
    border-color: #227738;
}

.setting-account-input {
    width: 130px;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #b9b9b9;
    font-family: inherit;
    font-size: 13px;
    margin-right: 10px;
    box-sizing: border-box;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 25px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfcfcf;
    border-radius: 999px;
    transition: 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider {
    background: rgba(124, 255, 122, 0.66);
}

.switch input:checked + .slider::before {
    transform: translateX(17px);
}

/* 
  =======================
  ASSIGNMENTS PAGE LAYOUT
  =======================
*/

.page-title {
    margin: 0;
    font-family: "Manrope";
    font-size: 34px;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.75;
}

/* 3-column layout: subjects / all assignments | main | widgets */
.assignments-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 180px 300px;
    grid-template-rows: minmax(300px, auto) auto;
    gap: 16px;
    row-gap: 20px;
    column-gap: 16px;
    align-items: start;
}

/* Subjects panel */
.subjects-panel { position: relative; }

.subjects-panel {
    border: 2px solid rgb(3, 46, 8);
    background-color: rgb(141, 157, 141);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: left;

    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.subjects-panel.has-more::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 28px;
    pointer-events: none;
    border-radius: 8px;
    background: linear-gradient(to bottom, rgba(141, 157, 141, 0), rgba(141, 157, 141, 1));
}

.panel-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: "Manrope";
}

.panel-subtitle {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.75;
}

#subjects-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    justify-items: stretch;
    cursor: pointer;
    max-height: 225px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#subjects-list li {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    width: 100%;
}

#subjects-list .subject-item {
    background: rgba(255, 255, 255, 0.6);
    border: rgb(3, 46, 8) 2px solid;
    border-radius: 8px;
    padding: 10px 12px;
    display: block;
    margin-top: 6px;
    text-align: left;
    font-family: "Noto Sans";
    font-size: 14px;
    font-weight: 700;
    color: #111;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}

#subjects-list .subject-item.active {
    border-color: #111;
    font-weight: 800;
}

#subjects-list .subject-item:hover {
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

#subjects-list .subject-item:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Left column */
.assignments-table-card {
    border: 2px solid rgb(3, 46, 8);
    background-color: rgb(141, 157, 141);
    border-radius: 10px;
    padding: 14px 12px;

    grid-column: 1 / 4;
    grid-row: 2;
    align-self: start;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    overflow: visible;
}

.assignments-table-header {
    display: flex;
    justify-content: space-between;
    align-items: left;
    margin-bottom: 10px;
}

.table-title {
    margin: 0;
    font-family: "Manrope";
    font-size: 26px;
    font-weight: 700;
}

.assignments-table-wrap {
    overflow: auto;
    border-radius: 10px;
}

.assignments-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.6);
    font-family: "Manrope";
}

/* ALL ASSIGNMENTS table header */
.assignments-table th {
    background: rgba(139, 163, 133, 0.6);
    border-right: 1px solid rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    padding: 10px 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ALL ASSIGNMENTS table body (elements) */
.assignments-table td {
    background: rgba(255, 255, 255, 0.6);
    border-right: 1px solid rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 1;
}



/* Middle column */
.assignments-main {
    display: block;
    grid-column: 2; 
    grid-row: 1;
    align-self: start;
}

/* Controls row / Main widget (pie chart) */
.weighting-carousel {
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 10px;
    padding: 8px 16px 14px;
    max-width: 400px;
    min-height: calc(var(--pie-size) + 130px);
    height: auto;
    display: grid;
    align-content: start;
    row-gap: 20px;
    overflow: visible;
}

.weighting-carousel .carousel-header h3, .weighting-carousel .carousel-content, .weighting-carousel .carousel-dots {
    margin: 0;
}

#weighting-carousel svg path {
    stroke: none;
}

.carousel-content {
    display: grid;
    justify-content: center;
    justify-items: center;
}

.carousel-footer {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    align-items: center;
    width: calc(var(--pie-size) + 100px);
    max-width: 100%;
    justify-self: center;
}

.carousel-subject {
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-slide {
    width: calc(var(--pie-size) + 36px);
    min-height: calc(var(--pie-size) + 8px);
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    justify-self: center;
}

.carousel-slide svg {
    display: block;
    width: var(--pie-size);
    height: var(--pie-size);
    overflow: visible;
}

.pie-slice {
    cursor: pointer;
    stroke: #ffffff;
    stroke-width: 2;
    transition: transform 0.15s ease, filter 0.15s ease, stroke-width 0.15s ease;
    transform-origin: center;
}

.pie-slice:hover {
    filter: brightness(1.15);
    stroke-width: 3;
    transition: transform 0.3s ease, filter 0.3s ease;
    transform: scale(1.10);
}

.pie-label {
    font-size: 9px;
    font-weight: 700;
    fill: black;
    stroke: rgba(0, 0, 0, 0.55);
    stroke-width: 0.6;
    paint-order: stroke fill;
    pointer-events: none;
}

.pie-breakdown {
    margin-top: 6px;
    display: grid;
    gap: 4px;
    text-align: left;
    font-size: 11px;
    line-height: 1.3;
    max-width: 280px;
}

.pie-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.pie-breakdown-task {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carousel-nav {
    font-size: 18px;
    border-radius: 20px;
    background-color: black;
    color: white;
    border: 2px solid grey;
    width: 30px;
    height: 30px;
    align-self: center;
    justify-self: center;
    cursor: pointer;  
}

.carousel-nav:hover {
    background-color: rgb(80, 90, 80);
    cursor: pointer;
    border-color: black;
    color: black;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.carousel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #222;
    opacity: 0.3;
}

.carousel-dots span.active {
    opacity: 1;
}

.assignments-controls {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    justify-content: flex-start;
    justify-self: center;
    padding: 14px 12px;
    background: rgb(141, 157, 141);
    border: 2px solid rgb(3, 46, 8);
    border-radius: 10px;
    width: 100%;
    max-width: 180px;
    box-sizing: border-box;
    min-height: 295px;
}

/* for all "add" style buttons on the page */
.btn-primary {
    font-size: 18px;
    border-radius: 999px;
    background-color: black;
    border: 2px solid grey;
    color: white;
    width: 30px;
    height: 30px;
    padding: 0;
    box-sizing: border-box;
    display: inline-grid;
    place-items: center;
    line-height: 1;
    align-self: center;
    justify-self: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.btn-primary:hover {
    background-color: rgb(80, 90, 80);
    cursor: pointer;
    border-color: black;
    color: black;
}

.btn-secondary {
    font-size: 14px;
    border-radius: 5px;
    background-color: rgb(141, 157, 141);
    border: 2px solid black;
    color: black;
    width: 70px;
    height: 30px;
    align-self: center;
    justify-self: center;
}

.btn-secondary:hover {
    background-color: rgb(80, 90, 80);
    cursor: pointer;
    border-color: grey;
    color: black;
}

#reset-btn {
    background-color: rgba(144, 190, 144, 0.6);
}

#reset-btn:hover {
    background-color: rgb(80, 90, 80);
    cursor: pointer;
    border-color: grey;
    color: black;
}

.controls-group {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.assignments-controls .controls-group:first-child {
    justify-items: center;
}

.control-label {
    font-family: "Noto Sans";
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.control-select {
    font-family: "Noto Sans";
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 2px solid #111;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.6);
}

#assignments-sort, #assignments-filter {
    width: 100%;
    max-width: 155px;
}

/* Right widgets column */
.assignments-widgets {
    display: grid;
    gap: 20px;
    align-content: start;
    justify-items: stretch;
    grid-column: 4; 
    grid-row: 1 / 3;
    align-self: start;
}

.widget-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 12px;
    text-align: left;
    min-height: 150px;
    padding: 12px;
    box-sizing: border-box;
}

.widget-title {
    font-family: "Manrope";
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 10px;
}

/* ===== Total Course Assignments widget ===== */

.total-assignments-widget .bars {
  display: flex;
  flex-direction: column;
  gap: 10px;

  /* baseline */
  border-left: 2px solid rgba(0,0,0,0.35);
  padding: 8px 10px 6px 12px;
}

.total-assignments-widget .bar-row {
  display: grid;
  gap: 6px;
}

.total-assignments-widget .bar-label {
  font-weight: 700;
  font-size: 12px;
  opacity: 0.9;
}

/* Trackline needs the bar area to expand to full width */
.total-assignments-widget .bar-trackline {
  display: grid;
  grid-template-columns: 1fr auto; /* bar takes all space, count is fixed */
  align-items: center;
  column-gap: 10px; /* spacing between bar end and number */
}

/* REMOVE the grey "track" entirely */
.total-assignments-widget .bar-track {
  width: 100%;
  height: 14px;
  background: transparent;   /* <-- key: no grey bar */
  overflow: visible;         /* no clipping needed */
}

/* Coloured bar */
.total-assignments-widget .bar-fill {
  height: 14px;
  width: 0%;
  border-radius: 5px;
}

/* Number on the right */
.total-assignments-widget .bar-count {
  min-width: 20px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  margin-left: 0px; /* a touch more breathing room */
}

/* Axis wrapper should NOT be a flex row */
.total-assignments-widget .axis {
  padding: 6px 10px 0 12px; /* align with bars baseline padding */
}

/* Bottom number line */
.total-assignments-widget .axis-bottom-line {
  height: 2px;
  background: rgba(0,0,0,0.35);
  margin: 4px 0 6px;
}

/* Vertical line layout */
.total-assignments-widget .axis-vertical-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.75;
}

/* Legend */
.total-assignments-widget .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 10px 10px 10px;
  font-size: 12px;
}

.total-assignments-widget .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.total-assignments-widget .legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ===== Assignments Dashboard Widget ===== */
.dash-widget {
  padding: 10px 10px 12px;
}

.dash-tabs {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dash-nav {
    font-size: 18px;
    border-radius: 20px;
    background-color: black;
    border: 2px solid grey;
    color: white;
    width: 30px;
    height: 30px;
    align-self: center;
    justify-self: center;
    cursor: pointer;  
}

.dash-nav:hover {
    background-color: rgb(80, 90, 80);
    cursor: pointer;
    border-color: black;
    color: black;
}

.dash-label {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  opacity: 0.9;
}

.dash-slide {
  min-height: 210px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vertical bar chart */
.vchart {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 10px;
}

.vchart-plot {
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  padding: 0 8px;
  border-left: 2px solid rgba(0,0,0,0.35); /* y-axis */
  border-bottom: 2px solid rgba(0,0,0,0.55); /* x-axis baseline */
}

.vbar {
  width: 18px;
  border-radius: 5px;
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: visible;
  height: 120px;
  padding-bottom: 0;
}

.vbar-fill {
  width: 100%;
  border-radius: 5px;
  height: 0%;
  bottom: auto;
  height: calc(var(--h, 0%) - 0px);
}

.vbar-count {
  position: static;
  transform: none;
  left: auto;
  top: auto;
  bottom: auto;
  margin-top: 6px;
  font-size: 12px;
}

.vbar-label {
  text-align: center;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 10px;
}

.vchart-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 6px;
  font-size: 12px;
  align-items: center;
}

.vchart-legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.vchart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.dash-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dash-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
}

.dash-dots span.active {
  background: rgba(0,0,0,0.7);
}

/* Add subjects / subjects panel additional CSS styling settings */
.hidden { display: none; }

.subjects-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.subjects-panel-header .panel-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

/* this is needed because the base styling for btn-primary isn't enough to handle for how this fits within the subjects card */
#add-subject-btn {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

#subject-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
}

#add-subject-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    width: min(420px, 90vw);
    z-index: 900;
    text-align: left;
}

#add-subject-modal .form-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: start;
    column-gap: 12px;
    margin: 12px 0;
}

#add-subject-modal .form-row label {
    text-align: left;
    margin: 0;
    padding-top: 8px;
}

#add-subject-modal .form-row input {
    font-family: "Noto Sans";
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#modal-backdrop { z-index: 9; }

#add-subject-modal input, #add-task-modal textarea {
    width: 80%;
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: "Noto Sans";
}

#add-subject-modal select {
    width: 60%;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: "Noto Sans";
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

#subject-status.task-status {
    margin: 8px 0 12px;
    font-family: "Noto Sans";
    font-weight: 700;
    text-align: center;
    min-height: 1.2em;
}

/* ADD ASSIGNMENTS STYLING */
button, input, select, textarea { font-family: inherit; }

#modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 850;
}

#add-assignment-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 92vw);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    z-index: 900;
    text-align: left;
}

#add-assignment-modal .form-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: start;
    column-gap: 12px;
    margin-bottom: 12px;
}

#add-assignment-modal .form-row label {
    text-align: left;
    margin: 0;
    padding-top: 8px;
}

#modal-backdrop { z-index: 9; }

#add-assignment-modal input, #add-assignment-modal textarea {
    width: 80%;
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: "Noto Sans";
}

#add-assignment-modal select {
    width: 60%;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: "Noto Sans";
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

#view-assignment-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(460px, 92vw);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 16px;
    z-index: 900;
    text-align: left;
}

.view-assignment-desc {
    margin: 8px 0 0;
    font-family: "Noto Sans";
    font-size: 14px;
    line-height: 1.45;
    color: #111;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 1200px) {
    .assignments-layout {
        grid-template-columns: 200px minmax(0, 1fr) 170px;
        grid-template-rows: auto auto auto;
        gap: 16px;
    }

    .subjects-panel {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    .assignments-main {
        grid-column: 2;
        grid-row: 1;
    }

    .assignments-controls {
        grid-column: 3;
        grid-row: 1;
        width: 100%;
        max-width: none;
        min-height: 0;
        padding: 12px 10px;
    }

    .weighting-carousel {
        width: 100%;
        max-width: none;
        min-height: 0;
        padding: 12px 14px;
        --pie-size: 130px;
    }

    .carousel-footer {
        width: min(100%, calc(var(--pie-size) + 60px));
    }

    .assignments-widgets {
        grid-column: 2 / 4;
        grid-row: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .widget-card {
        min-height: 0;
    }

    .dash-slide {
        min-height: 170px;
    }

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

    .assignments-table-card {
        grid-column: 1 / 4;
        grid-row: 3;
    }
}

@media (max-width: 860px) {
    .assignments-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .subjects-panel,
    .assignments-main,
    .assignments-controls,
    .assignments-widgets,
    .assignments-table-card {
        grid-column: 1;
        grid-row: auto;
    }

    .assignments-controls,
    .weighting-carousel {
        width: 100%;
        max-width: 100%;
    }

    .assignments-controls {
        min-height: 0;
    }

    .assignments-widgets {
        grid-template-columns: 1fr;
    }
}
