:root {
  --bg: #f4f7f2;
  --bg-soft: #fbfdfb;
  --panel: rgba(255,255,255,.94);
  --panel-strong: #ffffff;
  --primary: #15763f;
  --primary-2: #2ca55f;
  --primary-3: #7fd37f;
  --primary-soft: #e8f6eb;
  --primary-soft-2: #f3fbf5;
  --text: #163324;
  --muted: #6a7f72;
  --border: #dce9df;
  --danger: #d64f4f;
  --warning: #b88516;
  --shadow: 0 30px 60px rgba(18, 55, 33, 0.10);
  --shadow-soft: 0 14px 30px rgba(19, 60, 34, 0.06);
  --radius: 24px;
  --radius-sm: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(48, 170, 91, .14), transparent 20%),
    radial-gradient(circle at bottom left, rgba(127, 211, 127, .12), transparent 14%),
    radial-gradient(circle at top right, rgba(35, 120, 74, .10), transparent 16%),
    linear-gradient(135deg, #f1f6f2, #fbfdfb 44%, #eff7f1);
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 320px 1fr; }
.sidebar {
  position: sticky; top: 0; min-height: 100vh; align-self: start;
  display: flex; flex-direction: column; justify-content: space-between; gap: 26px;
  padding: 28px 22px;
  background:
    radial-gradient(circle at 15% 10%, rgba(151, 230, 163, .18), transparent 22%),
    linear-gradient(180deg, rgba(10, 58, 31, .98), rgba(16, 92, 48, .95));
  color: #eef7f0;
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand-wrap {
  padding: 20px; border-radius: 28px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 900; letter-spacing: -.04em; }
.brand-mark {
  width: 54px; height: 54px; border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #83d66f, #1f8f50);
  box-shadow: 0 14px 24px rgba(31, 143, 80, .28);
}
.brand-mark svg { width: 28px; height: 28px; fill: #fff; }
.brand-subtitle { margin-top: 12px; color: rgba(255,255,255,.76); font-size: 13px; line-height: 1.6; }
.user-chip {
  margin-top: 18px; padding: 14px 16px; border-radius: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
}
.user-chip strong { display: block; font-size: 14px; }
.user-chip span { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 12px; }
.nav { display: grid; gap: 10px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 17px;
  font-weight: 700; color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.nav a:hover, .nav a.active {
  transform: translateX(4px);
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.16);
}
.nav-icon { width: 18px; height: 18px; display: inline-flex; }
.nav-icon svg { width: 18px; height: 18px; fill: currentColor; }
.footer-note { color: rgba(255,255,255,.72); font-size: 13px; }
.main-content { padding: 30px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar-badge {
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 999px;
  background: #e9f6ed; color: var(--primary);
  border: 1px solid #d5ead9; font-size: 12px; font-weight: 800;
}
.topbar-title { margin-top: 10px; font-size: 26px; font-weight: 900; letter-spacing: -.04em; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.page-header h1 { margin: 0 0 8px; font-size: 40px; line-height: 1.02; letter-spacing: -.05em; }
.page-header p { margin: 0; max-width: 760px; }
.muted, .mini-muted { color: var(--muted); }
.mini-muted { font-size: 12px; margin-top: 4px; line-height: 1.5; }
.helper-text { color: var(--muted); font-size: 13px; margin-top: 14px; }
.card, .stat-card {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
}
.card::before, .stat-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, #65c56f, #1f8f50, #9ce271);
}
.hero-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.97), rgba(245,252,247,.94)),
    radial-gradient(circle at bottom right, rgba(127, 211, 127, .12), transparent 28%);
}
.form-card { min-height: 100%; }
.import-card {
  background:
    linear-gradient(145deg, #ffffff, #f8fcf9),
    radial-gradient(circle at bottom right, rgba(100, 207, 126, .10), transparent 26%);
}
.module-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.module-header h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card span { display: block; color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin-top: 10px; font-size: 40px; line-height: 1; }
.stat-card p { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.split-grid { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 18px; }
.content-grid-2 { display: grid; grid-template-columns: minmax(370px, 460px) 1fr; gap: 18px; }
.toolbar-row, .actions-inline, .schedule-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; gap: 14px; }
.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
.full { grid-column: 1 / -1; }
label span, .field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; color: #244735; }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 16px; background: #fcfffd;
  padding: 13px 14px; color: var(--text); outline: none;
  box-shadow: inset 0 1px 2px rgba(14, 57, 31, .03);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #74c58d;
  box-shadow: 0 0 0 4px rgba(81, 183, 106, .12);
}
.checkbox {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 14px; background: #fbfffc;
}
.checkbox input { width: auto; }
.checkbox.compact { padding: 10px 12px; border-radius: 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.compact-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 12px 18px; border: none; border-radius: 15px;
  font-weight: 800; letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 14px 24px rgba(26, 121, 68, .22); }
.btn.secondary { color: var(--primary); background: linear-gradient(180deg, #f4fbf6, #e6f6ea); border: 1px solid #d4ead9; box-shadow: var(--shadow-soft); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px dashed #bdddc7; box-shadow: none; }
.btn.small { min-height: 40px; padding: 10px 14px; border-radius: 12px; }
.field-inline {
  min-width: 280px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 16px; background: #fbfffc; padding: 0 12px;
}
.field-inline select, .field-inline input { border: none; box-shadow: none; padding-left: 0; }
.field-inline-icon svg { width: 18px; height: 18px; fill: var(--primary); }
.alert {
  padding: 15px 16px; border-radius: 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-soft); border: 1px solid transparent;
}
.success { background: #eaf9ef; color: #165d39; border-color: #cde8d6; }
.error { background: #fff1f1; color: #8d3030; border-color: #f0d3d3; }
.warning { background: #fff8e7; color: #7a5b10; border-color: #efdfaf; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,.72); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 14px; text-align: left; border-bottom: 1px solid #e5efe7; vertical-align: top; }
th { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #f7fbf8; }
.data-table tr:hover td { background: rgba(237, 247, 240, .72); }
.actions-col { width: 120px; text-align: center; }
.table-actions { display: inline-flex; align-items: center; gap: 8px; }
.table-actions form { margin: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid #d9e8de; background: #f8fcf9;
  display: inline-flex; align-items: center; justify-content: center; color: var(--primary);
  box-shadow: var(--shadow-soft); transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:hover { transform: translateY(-1px); background: #ecf7ef; }
.icon-btn.danger { color: var(--danger); }
.status-pill {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .01em;
}
.status-pill.success { background: #e8f7ec; color: #13653a; }
.status-pill.warning { background: #fff3d8; color: #855e04; }
.status-pill.muted { background: #f0f4f2; color: #6c7b72; }
.dropzone {
  position: relative; border: 1.5px dashed #c2dcc9; border-radius: 22px; padding: 22px;
  background: linear-gradient(180deg, #fbfefc, #f3faf5); text-align: center;
}
.dropzone.compact { text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.dropzone input[type=file] {
  margin-top: 14px; border-radius: 14px; background: #fff;
}
.dropzone-icon {
  width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 12px;
  display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #eefaf1, #dff2e5); color: var(--primary);
}
.dropzone.compact .dropzone-icon { margin: 0; }
.dropzone-icon svg { width: 24px; height: 24px; fill: currentColor; }
.upload-panel { display: grid; gap: 16px; }
.template-box, .note-box {
  padding: 16px; border-radius: 18px; border: 1px dashed #c4ddca; background: linear-gradient(180deg, #f7fcf8, #eef8f1);
}
.template-box code { color: var(--primary); font-size: 13px; line-height: 1.6; white-space: normal; word-break: break-word; }
.empty-state {
  text-align: center; padding: 26px; border-radius: 18px; border: 1px dashed #c6dfce; background: #f8fcf9; color: var(--muted);
}
.simple-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: var(--text); }
.inline-form { display: grid; gap: 12px; }
.progress { height: 12px; background: #edf5ef; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress > div { height: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.availability-grid {
  display: grid; grid-template-columns: 120px repeat(5, minmax(0,1fr)); gap: 10px;
  padding: 16px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(246,252,247,.92)); border: 1px solid var(--border);
}
.availability-head {
  padding: 12px; border-radius: 14px; text-align: center; font-weight: 800; color: var(--muted); background: #f8fcf9;
}
.slot {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 84px;
  padding: 16px 10px; border-radius: 18px; cursor: pointer; font-weight: 700;
  background: linear-gradient(180deg, #f5fbf6, #edf7ef); border: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease;
}
.slot input { display: none; }
.slot.selected, .slot:has(input:checked) {
  color: #fff; border-color: #1f8f50; background: linear-gradient(180deg, #31a45e, #177a42); box-shadow: 0 12px 20px rgba(31, 143, 80, .2);
}
.slot:hover { transform: translateY(-1px); }
.schedule-panel {
  padding: 26px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,250,245,.95));
}
.schedule-table td { min-width: 150px; }
.schedule-table td:first-child { font-weight: 800; color: var(--primary); background: #f7fbf8; }
.schedule-cell {
  min-height: 100px; padding: 14px; border-radius: 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  color: #fff; background: linear-gradient(180deg, var(--primary), #166f3a); box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.schedule-cell.empty { color: var(--muted); background: linear-gradient(180deg, #f7fbf8, #eef6f0); border: 1px dashed #c8dccf; box-shadow: none; }
.subject-name { font-weight: 800; }
.schedule-cell .mini-muted { color: rgba(255,255,255,.85); }
.guest-body {
  min-height: 100vh; display: grid; place-items: center; padding: 34px;
  background:
    radial-gradient(circle at bottom center, rgba(124, 213, 136, .14), transparent 18%),
    radial-gradient(circle at bottom left, rgba(84, 190, 113, .12), transparent 16%),
    linear-gradient(135deg, #f1f7f2, #ffffff 45%, #eef7ef);
}
.login-wrapper { width: 100%; display: flex; justify-content: center; }
.login-card {
  width: min(600px, 100%); padding: 40px; border-radius: 34px; position: relative; overflow: hidden;
  background: rgba(255,255,255,.97); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 30px 70px rgba(17, 74, 40, .14);
}
.login-card::after {
  content: ""; position: absolute; left: -30px; right: -30px; bottom: -90px; height: 190px;
  background: radial-gradient(circle at center, rgba(98, 201, 122, .24), transparent 46%);
  pointer-events: none;
}
.login-card h1 { margin: 10px 0 8px; font-size: 46px; line-height: .98; letter-spacing: -.05em; }
.password-card h1 { font-size: 40px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  background: #edf8f0; color: var(--primary); border: 1px solid #d7eadc; font-size: 12px; font-weight: 800;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 900; color: var(--primary); }
.auth-brand .brand-mark { width: 56px; height: 56px; border-radius: 19px; }
.hero-note {
  margin: 18px 0 22px; padding: 18px; border-radius: 22px;
  background: linear-gradient(180deg, #f3fbf5, #ebf7ef); border: 1px solid #d7eadc;
}
.guest-footer { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); font-size: 13px; color: var(--muted); }
.floating-alert { position: fixed; top: 18px; right: 18px; z-index: 50; min-width: 280px; }
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split-grid, .content-grid-2, .two-col, .checkbox-grid, .compact-grid, .availability-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; min-height: auto; }
  .main-content { padding: 20px; }
  .page-header, .module-header, .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .login-card { padding: 28px; }
  .login-card h1 { font-size: 38px; }
  .page-header h1 { font-size: 34px; }
  .stats-grid { grid-template-columns: 1fr; }
}
