:root{
  /* Paper background */
  --bg: #f4f1ec;
  --paper: #faf8f4;

  /* Surfaces */
  --surface: rgba(0,0,0,.035);
  --surface2: rgba(0,0,0,.055);
  --line: rgba(0,0,0,.12);

  /* Text */
  --text: #1a1c22;
  --muted: #5a627a;

  /* Red accent (warm, teacher-friendly) */
  --accent: #d62828;
  --accentGlow: rgba(214, 40, 40, .18);

  --radius: 18px;
}


*{ box-sizing:border-box; }
html, body { height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% 6%, var(--accentGlow), transparent 60%),
    linear-gradient(180deg, #ffffff, var(--bg) 35%, var(--bg));
}


/* Layout */
.container{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

/* Top bar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 18px; 
}
.logo{
  color: var(--text);
  text-decoration:none;
  font-weight: 850;
  letter-spacing: .2px;
  display:flex;
  align-items:center;
  gap: 10px;
}
.logo__dot{
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accentGlow);
}
.nav a{
  color: var(--muted);
  text-decoration:none;
  margin-left: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}
.nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
}

/* Typography helpers */
.muted{ color: var(--muted); }
.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: .84rem;
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
}
.badge::before{
  content:"";
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accentGlow);
}
.lead{
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 10px 0 0;
}

/* Surprising hero */
.hero{
  margin-top: 16px;
  display:grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
.panel{
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper), rgba(250,248,244,.9));
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.12);

}
.panel--glow{
  position: relative;
  overflow: hidden;
}
.panel--glow::after{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(520px 220px at 20% 10%, rgba(255, 59, 48, .18), transparent 60%),
    radial-gradient(420px 220px at 80% 0%, rgba(255,255,255,.08), transparent 60%);
  pointer-events:none;
}
.panel--glow > *{ position: relative; z-index: 1; }

h1{
  margin: 10px 0 0;
  font-size: clamp(2.05rem, 4vw, 2.8rem);
  letter-spacing: .2px;
}
.subline{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .95rem;
}
.subline span{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

/* Buttons */
.actions{ display:flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  text-decoration:none;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.06);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); }
.btn.primary{
  border-color: rgba(255, 59, 48, .55);
  background: linear-gradient(135deg, #d62828, #b91c1c);
  box-shadow: 0 10px 24px rgba(214,40,40,.28);

}
.btn.ghost{ background: transparent; }

/* Cards grid */
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 26px;
}
.card{
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
}


.card h2{ margin: 0 0 8px; font-size: 1.15rem; }
.card p{ margin: 0; color: var(--muted); line-height: 1.45; }

.card .meta{
  margin-top: 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: .92rem;
}
.pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.pill.red{
  border-color: rgba(255, 59, 48, .55);
  background: rgba(255, 59, 48, .10);
  color: #ffd4d1;
}

.textlink{
  display:inline-block;
  margin-top: 12px;
  color: var(--text);
  text-decoration:none;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
}
.textlink:hover{ background: rgba(255,255,255,.10); }

/* Footer */
.footer{
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 16px 0 26px;
}

/* Responsive */
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
}

/*****************css for the inventory page*******************/
/* Inventory layout */
.inv-layout{
  display:grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
  margin: 14px 0 26px;
}
@media (max-width: 900px){
  .inv-layout{ grid-template-columns: 1fr; }
}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}

.input{
  width: min(420px, 100%);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.65);
  color: var(--text);
  outline: none;
}
.input:focus{
  border-color: rgba(214,40,40,.35);
  box-shadow: 0 0 0 4px rgba(214,40,40,.12);
}

.table-wrap{
  overflow:auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}

.table{
  width:100%;
  border-collapse: collapse;
  min-width: 720px;
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  text-align:left;
  vertical-align: middle;
}
.table th{
  position: sticky;
  top: 0;
  background: rgba(250,248,244,.95);
  z-index: 1;
  font-size: .92rem;
  color: var(--muted);
}
.table tr:hover td{
  background: rgba(214,40,40,.06);
}

.rowlink{
  color: inherit;
  text-decoration:none;
  display:block;
}
.kpi{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.kpi .pill{ background: rgba(0,0,0,.03); }
.pill.ok{ border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.10); }
.pill.warn{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12); }
.pill.bad{ border-color: rgba(214,40,40,.45); background: rgba(214,40,40,.12); }


/******************* thumbnail component *******************/
.thumb{
  width: 100%;
  height: 220px;              /* fixed visual height */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;        /* KEEP proportions */
  padding: 10px;              /* breathing space */
}

.thumb--small{
  width: 64px;
  height: 48px;
  border-radius: 10px;
}

.thumb--small img{
  object-fit: contain;
}

/* Image zoom modal */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal.is-open{ display: block; }

.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(10,10,12,.62);
  backdrop-filter: blur(6px);
}

.modal__dialog{
  position: relative;
  max-width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  overflow: hidden;
}

.modal__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.modal__title{
  margin:0;
  font-size: 1rem;
  font-weight: 650;
}

.modal__close{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.65);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.modal__close:hover{
  border-color: rgba(214,40,40,.35);
}

.modal__body{
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px;
  max-height: calc(100vh - 140px);
}

.modal__img{
  width: 100%;
  height: auto;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  display:block;
}

.zoomable{
  cursor: zoom-in;
}

/************** Projects page (clean) ******************/

/* Layout: sidebar + main content */
.projects-layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:14px;
  align-items: stretch;
  margin: 14px 0 26px;
}

@media (max-width: 980px){
  .projects-layout{ grid-template-columns: 1fr; }
}

/* Left sidebar panel */
.projects-lists{
  height: calc(100vh - 220px);
  overflow: hidden;
}

.projects-lists .lists-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid var(--line);
}

.projects-lists .list-items{
  margin-top:12px;
  display:grid;
  gap:8px;
  overflow:auto;
  max-height: calc(100vh - 300px);
  padding-right: 6px;
}

/* Project list item */
.list-item{
  display:block;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: var(--surface);
  text-decoration:none;
  color: var(--text);
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}

.list-item:hover{
  transform: translateY(-1px);
  border-color: rgba(255,59,48,.35);
}

.list-item.active{
  border-color: rgba(255,59,48,.7);
  background: rgba(255,59,48,.06);
  box-shadow: 0 0 0 3px rgba(255,59,48,.10);
}

.list-item-title{
  font-weight: 750;
  margin-bottom:4px;
}

.list-item-meta{
  font-size:.88rem;
  color: var(--muted);
}

/* Right panel scrolls (so logs don't create page-length scrolling) */
.projects-detail{
  height: calc(100vh - 220px);
  overflow:auto;
  padding-bottom: 18px;
}

/* Header image for the selected project */
.detail-img{
  display:block;
  border-radius: var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
}

.detail-img img{
  width:100%;
  height: 260px;
  object-fit: cover;
  display:block;
}

/* Notes box */
.detail-notes{
  margin-top:12px;
  padding:12px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  line-height: 1.45;
}

/* Logs */
.log-list{
  display:grid;
  gap:12px;
}

/* Compact card */
.log-item{
  border:1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding:10px;
  display:grid;
  gap:10px;
}

.log-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:6px;
}

.log-img{
  display:block;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid var(--line);
}

.log-img img{
  width:100%;
  height:110px;
  object-fit: cover;
  display:block;
}

.log-text{
  color: var(--text);
  line-height:1.45;
  font-size: .95rem;
}

/* Option C improvement: image left + text right on desktop */
@media (min-width: 900px){
  .log-item{
    grid-template-columns: 220px 1fr;
    align-items:start;
  }
  .log-meta{ grid-column: 1 / -1; }
  .log-img img{ height:130px; }
}

.projects-layout{ margin-top:14px; }

/* Right panel header spacing */
.detail-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-top:12px;
}

/* Recent activity spacing */
.detail-activity{ margin-top:14px; }

/* Keep the right panel from feeling too wide on huge screens */
.projects-detail{ min-width: 0; }

/* Avoid long titles breaking layout */
.list-item-title{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.log-scroll{
  overflow:auto;
  max-height: 420px;   /* adjust */
  padding-right: 6px;
}


/* Reduce overall vertical density */
.panel{
  padding: 14px;            /* was 18px */
}

h1{
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); /* slightly smaller */
}

.lead{
  font-size: 1rem;
}

/* Project detail image: less tall */
.detail-img img{
  height: 220px;            /* was 260px */
}

/* Logs slightly more compact */
.log-item{
  padding: 8px;
}

.log-text{
  font-size: .92rem;
}

/* Prevent horizontal scroll in project list */
.projects-lists{
  overflow-x: hidden;
}

/* Truncate long titles nicely */
.list-item-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.list-item{
  padding: 9px 12px;        /* smaller */
  background: rgba(0,0,0,.025);
}

.list-item:hover{
  background: rgba(214,40,40,.06);
}


