:root {
  --bg: #f7f4ef;
  --bg-soft: #f3eee7;
  --card: #fffdf9;
  --card-soft: rgba(255, 253, 249, 0.95);
  --line: #e7ddd0;
  --table-line: #d9cfbf;

  --text: #3f342c;
  --subtext: #7a6b60;
  --primary: #8f6f5a;
  --primary-dark: #765845;

  --soft-peach: #f7e7dc;
  --input-bg: #fffaf5;

  --th-base: #fff8f1;
  --th-first: #dce7f2;
  --th-second: #ead7df;
  --th-total: #dce8d2;
  --sum-base: #f7efe4;

  --shadow: 0 10px 30px rgba(111, 88, 69, 0.08);
  --shadow-strong: 0 18px 40px rgba(111, 88, 69, 0.12);

  --flash-success-bg: #f3f8ea;
  --flash-success-border: #d8dfc9;
  --flash-success-text: #536145;

  --flash-error-bg: #fbe9e7;
  --flash-error-border: #efd2cd;
  --flash-error-text: #8a4d44;
}

/* =========================
   Reset
========================= */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fbf6ef 0%, #f7f4ef 45%, var(--bg-soft) 100%);
}

/* =========================
   Layout
========================= */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(255, 250, 244, 0.9);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  backdrop-filter: blur(8px);
}

.content {
  padding: 24px 28px;
}

/* =========================
   Sidebar
========================= */
.brand {
  margin-bottom: 28px;
}

.brand .title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary-dark);
}

.brand .desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.5;
}

.profile-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.profile-label {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 8px;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-info {
  font-size: 13px;
  color: var(--subtext);
  line-height: 1.6;
}

.profile-action {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd1c2;
}

.profile-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
  cursor: pointer;
}

.profile-link:hover {
  text-decoration: underline;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.menu-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: #fff8f1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
}

.menu-item.active {
  background: var(--soft-peach);
  border-color: #dfc5b1;
  color: var(--primary-dark);
}

.menu-item.logout {
  margin-top: 8px;
  background: #fff;
}

.menu-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(143, 111, 90, 0.08);
}

/* =========================
   Page header
========================= */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--primary-dark);
}

.page-subtitle {
  margin-top: 10px;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.6;
}

.today-box {
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  text-align: right;
}

.today-box .small {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 6px;
}

.today-box .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* =========================
   Cards / panels / sections
========================= */
.card,
.main-card {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: visible;
}

.card {
  margin-bottom: 20px;
}

.card-inner,
.main-card-inner {
  padding: 24px;
}

.main-card-inner {
  padding-bottom: 32px;
}

.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 22px;
  align-items: start;
}

.section {
  margin-bottom: 26px;
}

.section:last-child {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-badge {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.badge-basic {
  background: #cab49d;
}

.badge-request {
  background: #d6aa8d;
}

.badge-first {
  background: #9db8d3;
}

.badge-second {
  background: #d8a8b0;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.section-desc {
  margin-top: 4px;
  margin-left: 22px;
  margin-bottom: 14px;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.5;
}

.panel {
  background: #fffaf5;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.panel.peach {
  background: #fff7f1;
}

.panel.first {
  background: #eef5fb;
  border: 1px solid #cddfee;
  padding: 18px 18px 22px;
}

.panel.second {
  background: #f6eaf0;
  border: 1px solid #e2c8d4;
  padding: 18px 18px 22px;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e6d8c9, transparent);
  margin: 22px 0;
}

.helper-card {
  margin-top: 20px;
  background: #fffaf5;
  border: 1px dashed #dccdbc;
  border-radius: 18px;
  padding: 16px;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.7;
}

.helper-card strong {
  color: var(--primary-dark);
}

/* =========================
   Flash
========================= */
.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--flash-success-border);
  background: var(--flash-success-bg);
  color: var(--flash-success-text);
}

.flash.error {
  border-color: var(--flash-error-border);
  background: var(--flash-error-bg);
  color: var(--flash-error-text);
}

/* =========================
   Forms
========================= */
.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #decfbe;
  background: var(--input-bg);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: 0.2s ease;
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #bc9b84;
  box-shadow: 0 0 0 4px rgba(188, 155, 132, 0.12);
  background: #fffefb;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b5a79b;
}

.readonly-box {
  background: #f7f0e9 !important;
  color: #6d5d50;
  font-weight: 600;
}

button:disabled,
select:disabled,
input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================
   Buttons
========================= */
.action-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.submit-area {
  margin-top: 30px;
  padding-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.submit-btn,
.filter-btn,
.login-btn {
  border: 0;
  border-radius: 16px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(118, 88, 69, 0.22);
  transition: 0.2s ease;
}

.submit-btn:hover,
.filter-btn:hover,
.login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.submit-btn {
  min-width: 220px;
  min-height: 50px;
}

.filter-btn {
  padding: 12px 18px;
  font-size: 14px;
  border-radius: 12px;
  text-decoration: none;
}

.login-btn {
  width: 100%;
  margin-top: 8px;
}

.load-btn {
  border: 1px solid #d8c7b7;
  background: #fffaf5;
  color: #6e5645;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.role-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f3e8db;
  color: #7a5a45;
}

/* =========================
   Grid / filters
========================= */
.grid-2,
.grid-5 {
  display: grid;
  gap: 14px;
}

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

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

.inline-row {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: nowrap;
}

.inline-row .field {
  flex: 1;
  min-width: 0;
}

.inline-row .field.month {
  flex: 0 0 180px;
}

.inline-row .field.event {
  flex: 1 1 auto;
}

.inline-row .field.group {
  flex: 0 0 180px;
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-row .field {
  margin-bottom: 0;
  min-width: 0;
}

.filter-row .field.month-field,
.filter-row .field.date-field {
  width: 140px;
}

.filter-row .field.search-field {
  width: 180px;
}

.filter-row .field.host-main-field,
.filter-row .field.host-sub-field {
  width: 110px;
}

.filter-row .btn-group {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.filter-row .filter-btn,
.filter-row .load-btn {
  height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  margin: 0;
}

/* =========================
   Tables common
========================= */
.table-wrap {
  overflow: auto;
  max-height: 600px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border: 1px solid #eee1d3;
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  background: var(--th-base);
  color: var(--primary-dark);
  font-weight: 800;
  white-space: nowrap;
}

td {
  color: var(--text);
  background: #fffdf9;
}

tr:hover td {
  background: #fffaf4;
}

.empty-text {
  color: var(--subtext);
  font-size: 14px;
  padding: 20px 0;
}

/* =========================
   Stats table
========================= */
.stats-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  border: 1px solid var(--table-line) !important;
  padding: 4px 6px;
  font-size: 11px;
  vertical-align: middle;
}

.stats-table th {
  text-align: center;
  font-weight: 800;
  white-space: nowrap;
}

.stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: none !important;
}

.th-base,
.stats-table thead th.th-base {
  background: var(--th-base) !important;
}

.th-first,
.stats-table thead th.th-first {
  background: var(--th-first) !important;
}

.th-second,
.stats-table thead th.th-second {
  background: var(--th-second) !important;
}

.th-total,
.stats-table thead th.th-total {
  background: var(--th-total) !important;
}

.text-center {
  text-align: center;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
}

.num-col {
  min-width: 64px;
}

.col-date {
  min-width: 78px;
  max-width: 78px;
}

.col-time {
  min-width: 72px;
  max-width: 72px;
  white-space: nowrap;
}

.col-name {
  min-width: 150px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-place {
  min-width: 90px;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-speaker {
  min-width: 110px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-group {
  min-width: 52px;
  max-width: 52px;
  white-space: nowrap;
}

.group-row td {
  background: #fcfaf7;
}

.sum-row td {
  font-weight: 800;
}

.sum-cell-first {
  background: var(--th-first) !important;
  font-weight: 800;
}

.sum-cell-second {
  background: var(--th-second) !important;
  font-weight: 800;
}

.sum-cell-total {
  background: var(--th-total) !important;
  font-weight: 800;
}

.sum-cell-base {
  background: var(--sum-base) !important;
  font-weight: 800;
}

.rowspan-cell {
  vertical-align: middle !important;
  text-align: center !important;
}

.stats-divider-left {
  border-left: 3px solid #bfae9d !important;
}

.stats-divider-right {
  border-right: 3px solid #bfae9d !important;
}

/* =========================
   Daily records
========================= */
.daily-table-wrap {
  max-height: 65vh;
  overflow: auto;
}

.daily-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 8;
}

.action-cell {
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

.action-cell form {
  display: inline-block;
  margin: 0 2px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}

.btn-icon:hover {
  background: #f7f4ef;
}

.btn-icon.edit {
  color: #5a7aa0;
}

.btn-icon.delete {
  color: #c75b5b;
}

.mini-count-box {
  background: #fff8f1;
  border: 1px solid #e0d2c2;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #6b5442;
}

/* =========================
   Toggle / pagination
========================= */
.stats-toggle-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.toggle-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #cdbba8;
  border-radius: 8px;
  background: #fffaf5;
  color: #6e5645;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.toggle-btn:hover {
  background: #f3e8db;
}

.sort-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 800;
}

.sort-link:hover {
  text-decoration: underline;
}

.pagination-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 13px;
  color: var(--subtext);
  font-weight: 700;
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d8c7b7;
  border-radius: 10px;
  background: #fffaf5;
  color: #6e5645;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination span.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: var(--primary-dark);
}

/* =========================
   Login page
========================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #fbf7f1 0%, #f7f2ea 35%, #f2ebe2 100%);
}

.login-shell {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: rgba(255, 251, 246, 0.75);
  border: 1px solid rgba(229, 216, 202, 0.7);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(111, 88, 69, 0.10);
  backdrop-filter: blur(10px);
}

.intro-panel {
  position: relative;
  padding: 56px 44px;
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.96), rgba(248, 240, 230, 0.96));
  border-right: 1px solid rgba(229, 216, 202, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff7ef;
  border: 1px solid #ead8c5;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 22px;
}

.intro-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cfa487;
  display: inline-block;
}

.intro-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -1px;
  color: var(--primary-dark);
  font-weight: 800;
}

.intro-desc {
  margin-top: 18px;
  max-width: 420px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--subtext);
  word-break: keep-all;
}

.info-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 36px;
  max-width: 430px;
}

.info-card {
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid #eadfce;
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 20px rgba(143, 111, 90, 0.05);
}

.info-card .label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--subtext);
}

.info-card .value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.info-card .small {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--subtext);
}

.login-panel {
  padding: 56px 44px;
  background: rgba(255, 253, 249, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-top {
  margin-bottom: 26px;
}

.login-small {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--subtext);
}

.login-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.8px;
  color: var(--primary-dark);
  font-weight: 800;
}

.login-desc {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--subtext);
  word-break: keep-all;
}

.bottom-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff8f1;
  border: 1px dashed #dccdbc;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.7;
  word-break: keep-all;
}

.bottom-note strong {
  color: var(--primary-dark);
}

/* =========================
   Modal
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(63, 52, 44, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal-box {
  width: 100%;
  max-width: 460px;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(111, 88, 69, 0.18);
  padding: 24px;
}

.modal-box-lg {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--primary-dark);
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--subtext);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .submit-btn {
  min-width: 140px;
}

.modal-actions .load-btn {
  min-width: 90px;
}

/* =========================
   Event admin
========================= */
.event-table-wrap {
  max-height: 65vh;
  overflow: auto;
}

.event-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--th-base) !important;
}

.btn-group .submit-btn {
  height: 48px;
  padding: 0 18px;
  font-size: 14px;
}

.mini-create-btn {
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(118, 88, 69, 0.18);
  transition: 0.2s ease;
  white-space: nowrap;
}

.mini-create-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.floating-create-btn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(118, 88, 69, 0.28);
  z-index: 1000;
  transition: 0.2s ease;
}

.floating-create-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.03);
}

.session-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr 64px;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.session-row .field {
  margin-bottom: 0;
}

.session-time-wrap {
  display: block;
}

.session-time-wrap input[type="time"] {
  height: 48px;
  width: 100%;
}

.session-delete-btn {
  height: 48px;
  width: 64px;
  border: 1px solid #d8c7b7;
  background: #fffaf5;
  color: #6e5645;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.session-delete-btn:hover {
  background: #f3e8db;
}

/* =========================
   Calendar independent pages
========================= */
.calendar-view-body {
  margin: 0;
  padding: 20px;
  background: #f5f7f5;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  color: #2f3a2f;
  overflow-x: hidden;
}

.calendar-view-wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}


.calendar-view-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-view-title {
  font-size: 28px;
  font-weight: 800;
  color: #2e7d32;
}

.calendar-view-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #777;
}

.calendar-view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-link-btn,
.calendar-logout-btn {
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-link-btn {
  background: #388e3c;
}

.calendar-link-btn:hover {
  background: #2e7d32;
}

.calendar-logout-btn {
  background: #d32f2f;
}

.calendar-logout-btn:hover {
  background: #b71c1c;
}

#calendar {
  width: 100%;
  background: white;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}

.fc {
  width: 100% !important;
}

.fc table {
  min-width: 0 !important;
  width: 100% !important;
}

.fc .fc-scrollgrid {
  width: 100% !important;
}

.fc .fc-daygrid-day-frame {
  min-height: 90px;
}

.fc-event {
  max-width: 100%;
  overflow: hidden;
}

.fc-event-title,
.fc-event-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc .fc-toolbar-title {
  font-size: 24px;
  font-weight: 800;
  color: #2e7d32;
}

.fc .fc-button-primary {
  background: #388e3c;
  border-color: #388e3c;
}

.fc .fc-button-primary:hover {
  background: #2e7d32;
  border-color: #2e7d32;
}

.fc-event {
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 12px;
  cursor: pointer;
}

.calendar-color-legend {
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #555;
}

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

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.calendar-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.calendar-detail-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.calendar-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-detail-title {
  font-size: 20px;
  font-weight: 800;
  color: #2e7d32;
}

.calendar-detail-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  color: #777;
  line-height: 1;
}

.calendar-detail-row {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  line-height: 1.5;
}

.calendar-detail-row:last-child {
  border-bottom: 0;
}

.calendar-detail-label {
  font-weight: 800;
  color: #555;
  margin-bottom: 3px;
}

.calendar-detail-value {
  color: #333;
  white-space: pre-line;
}

.calendar-filter-box {
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  width: fit-content;
}

.calendar-filter-box label {
  font-size: 13px;
  font-weight: 800;
  color: #555;
  white-space: nowrap;
}

.calendar-filter-box select {
  height: 36px;
  min-width: 120px;
  border-radius: 10px;
  border: 1px solid #d6c8ba;
  background: #fffaf5;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4d4038;
}

.calendar-toolbar-select {
  height: 36px;
  min-width: 130px;
  border-radius: 10px;
  border: 1px solid #cfcfcf;
  background: #fff;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #444;
  cursor: pointer;
}

.fc .fc-groupFilter-button {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* =========================
   행사 등록 표 관리 버튼 통일
========================= */
.event-table-wrap td:last-child {
  width: 150px;
  min-width: 150px;
}

.event-table-wrap td:last-child > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap !important;
}

.event-table-wrap td:last-child form {
  margin: 0;
}

.event-table-wrap td:last-child .load-btn,
.event-table-wrap td:last-child button,
.event-table-wrap .readonly-action {
  width: 58px;
  height: 30px;
  padding: 0;
  font-size: 12px;
  line-height: 30px;
  border-radius: 8px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.event-table-wrap .readonly-action {
  display: inline-block;
  background: #f3f0ec;
  border: 1px solid #ded3c8;
  color: #8a7a6c;
  font-weight: 700;
}



/* =========================
   Responsive 모바일
========================= */
@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(229, 216, 202, 0.8);
  }
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .inline-row {
    flex-wrap: wrap;
  }

  .inline-row .field.month,
  .inline-row .field.event,
  .inline-row .field.group {
    flex: 1 1 100%;
  }

  .page-header {
    flex-direction: column;
  }

  .today-box {
    width: 100%;
    text-align: left;
  }

  .submit-btn {
    width: 100%;
  }

  .submit-area {
    justify-content: stretch;
  }

  .calendar-view-body {
    padding: 12px;
    overflow-x: auto;
  }

}

@media (max-width: 700px) {
  .session-row {
    grid-template-columns: 1fr;
  }

  .session-delete-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 14px;
  }

  .intro-panel,
  .login-panel {
    padding: 30px 22px;
  }

  .intro-title {
    font-size: 30px;
  }

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

  .floating-create-btn {
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    font-size: 28px;
  }

  .calendar-view-top {
    align-items: flex-start;
  }

  .calendar-view-actions {
    width: 100%;
  }

  .calendar-link-btn,
  .calendar-logout-btn {
    flex: 1;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  .fc .fc-toolbar-title {
    font-size: 20px;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 18px;
  }

  .card-inner,
  .main-card-inner {
    padding: 18px;
  }

  .grid-5 {
    grid-template-columns: 1fr;
  }

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