/* admin.css */
:root {
  --kms-primary: #2271b1;
  --kms-bg: #f0f0f1;
  --kms-white: #ffffff;
  --kms-border: #c3c4c7;
  --kms-text: #3c434a;
  --kms-text-light: #646970;
  
  --kms-a4-width: 210mm;
  --kms-a4-height: 297mm;
}

/* ==============================================
   Admin Layout Settings
   ============================================== */
.kms-wrap {
  margin: 20px 20px 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--kms-text);
}

.kms-notice {
  background: var(--kms-white);
  border-left: 4px solid #46b450;
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.kms-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.kms-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--kms-white);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--kms-border);
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.kms-sidebar__inner {
  padding: 24px;
}

.kms-sidebar__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.kms-sidebar__icon svg {
  width: 32px;
  height: 32px;
  color: var(--kms-primary);
}

.kms-sidebar__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #1d2327;
}

.kms-sidebar__subtitle {
  font-size: 0.85rem;
  color: var(--kms-text-light);
  margin: 4px 0 0;
}

.kms-field-group {
  margin-bottom: 24px;
}

.kms-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e0e0e0;
  margin-bottom: 12px;
}
.kms-badge--blue { background: #e0f0ff; color: #005a9e; }
.kms-badge--green { background: #e6f4ea; color: #137333; }
.kms-badge--purple { background: #f3e8fd; color: #681da8; }

.kms-field {
  margin-bottom: 16px;
}

.kms-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.kms-hint {
  font-size: 0.8rem;
  color: var(--kms-text-light);
  margin: 0 0 8px 0;
}

.kms-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--kms-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.kms-textarea:focus {
  border-color: var(--kms-primary);
  box-shadow: 0 0 0 1px var(--kms-primary);
  outline: none;
}

.kms-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.kms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.kms-btn svg { width: 18px; height: 18px; }

.kms-btn--save {
  background: var(--kms-primary);
  color: white;
}

.kms-btn--save:hover {
  background: #135e96;
}

.kms-btn--print {
  background: var(--kms-white);
  color: var(--kms-text);
  border: 1px solid var(--kms-border);
}

.kms-btn--print:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
}

/* ==============================================
   Preview Area
   ============================================== */
.kms-preview-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-x: auto;
}

.kms-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--kms-white);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--kms-border);
}

.kms-preview-label { font-weight: 600; }
.kms-preview-note { font-size: 0.85rem; color: var(--kms-text-light); }

#kms-print-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.kms-a4 {
  width: var(--kms-a4-width);
  height: var(--kms-a4-height);
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 15mm;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

/* ==============================================
   Enquete Page Styles (Print layout)
   ============================================== */
.eq-page {
  font-family: "MS Mincho", "Yu Mincho", serif; /* Japanese print vibe */
  color: #000;
  font-size: 11pt;
  line-height: 1.4;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.eq-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
}

.eq-header__logo {
  margin-right: 15px;
}

.eq-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid #000;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  font-family: sans-serif;
}

.eq-header__text {
  flex-grow: 1;
  text-align: center;
}

.eq-title { font-size: 14pt; font-weight: normal; margin-bottom: 4px; }
.eq-subtitle { font-size: 20pt; font-weight: bold; letter-spacing: 5px; }

/* Info Table */
.eq-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-family: sans-serif;
  font-size: 10pt;
}

.eq-info-table th, .eq-info-table td {
  border: 1px solid #000;
  padding: 6px 8px;
}

.eq-info-table th { background: #f0f0f0; width: 60px; text-align: center; }

.eq-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eq-choice { display: inline-block; }

/* Sections */
.eq-section {
  margin-bottom: 18px;
}

.eq-section__title {
  font-weight: bold;
  font-size: 12pt;
  margin-bottom: 8px;
  font-family: sans-serif;
}

.eq-num {
  display: inline-block;
  margin-right: 5px;
}

.eq-section__note {
  font-size: 9pt;
  font-weight: normal;
  margin-left: 10px;
}

/* Checkbox grids */
.eq-check-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 5px;
  font-size: 10pt;
  font-family: sans-serif;
}

.eq-check-item { display: flex; align-items: center; }
.eq-check-item--wide { grid-column: span 2; }
.eq-checkbox {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #000;
  margin-right: 6px;
}

.eq-check-grid--horizontal {
  display: flex;
  justify-content: space-between;
}

/* Instructors grid */
.eq-instructor-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  font-size: 10pt;
  font-family: sans-serif;
  margin-bottom: 10px;
}

.eq-instructor-name {
  border: 1px solid #000;
  padding: 5px;
  text-align: center;
  border-radius: 4px;
}

.eq-placeholder { color: #aaa; border-color: #aaa; border-style: dashed; }

.eq-other-line {
  font-size: 10pt;
  display: flex;
  align-items: center;
}

.eq-write-line {
  flex-grow: 1;
  border-bottom: 1px solid #000;
  margin-left: 10px;
  height: 1em;
}

/* Rating Tables */
.eq-rating-table {
  width: 100%;
  border-collapse: collapse;
  font-family: sans-serif;
  font-size: 10pt;
}

.eq-rating-table th, .eq-rating-table td {
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
}

.eq-rating-table th { background: #f0f0f0; }

.eq-rating-table__item-col { width: 60%; }
.eq-rating-table__item { text-align: left; padding-left: 10px !important; }

.eq-circle {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  border-radius: 50%;
}

.eq-rating-table__category-row { background: #e8e8e8; font-weight: bold; }
.eq-rating-table__category { text-align: left; padding-left: 10px !important; }

/* Write Areas */
.eq-write-area {
  border: 1px solid #000;
  height: 80px;
  width: 100%;
  margin-top: 5px;
}

.eq-write-area--lg { height: 120px; }

.eq-comment-box {
  border: 1px solid #000;
  flex-grow: 1;
  width: 100%;
  min-height: 100px;
}

.eq-section--comment {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.eq-footer {
  margin-top: auto;
  text-align: center;
  font-size: 10pt;
  padding-top: 20px;
}

.eq-footer__school {
  font-size: 14pt;
  font-weight: bold;
  margin-top: 10px;
  text-align: right;
}

/* ==============================================
   Print Styles
   ============================================== */
@media print {
  /* WordPress admin elements hide */
  #adminmenumain, #wpadminbar, .kms-sidebar, .kms-preview-toolbar, .notice, .update-nag { display: none !important; }
  
  /* Reset margins for print */
  html, body { background: transparent !important; margin: 0 !important; padding: 0 !important; }
  #wpcontent { margin-left: 0 !important; padding: 0 !important; }
  
  .kms-wrap { margin: 0; padding: 0; }
  
  /* The A4 pages */
  #kms-print-container {
    display: block;
    gap: 0;
  }
  
  .kms-a4 {
    box-shadow: none;
    margin: 0;
    width: 210mm;
    height: 297mm;
    page-break-after: always;
  }
}
