/* AICS FONT: Naver Barun Gothic / NanumBarunGothic preferred */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "NanumBarunGothic", "Nanum Barun Gothic", "Naver Barun Gothic", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

.page-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 270px;
  background: #101827;
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.brand-title { font-size: 18px; font-weight: 900; }
.brand-sub { margin-top: 4px; color: #a9b4c7; font-size: 12px; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav a {
  padding: 12px 13px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.side-box {
  margin-top: 28px;
  padding: 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #dbeafe;
}

.side-box b { color: #fff; font-size: 13px; }

.main {
  flex: 1;
  min-width: 0;
  padding: 28px;
}

.hero {
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  color: #fff;
  border-radius: 26px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow { font-size: 13px; color: #bfdbfe; font-weight: 900; }
.hero h1 { margin: 9px 0 12px; font-size: 32px; letter-spacing: -1px; }
.hero p { margin: 0; max-width: 900px; color: #dbeafe; line-height: 1.65; font-size: 15px; }

.hero-actions {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
}

.btn {
  border: 0;
  background: #fff;
  color: #1d4ed8;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.btn.ghost {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
}

.editplus-layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.file-panel,
.editor-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.file-panel {
  padding: 18px;
  height: calc(100vh - 220px);
  overflow: auto;
}

.editor-panel {
  padding: 22px;
  min-width: 0;
}

.path-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 5px;
}

.path-text {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: #1d4ed8;
  word-break: break-all;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.file-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
}

.file-btn:hover,
.file-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
}

.file-btn .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.file-btn b {
  font-size: 14px;
  word-break: break-all;
}

.file-btn span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.dir { background: #dbeafe; color: #1d4ed8; }
.badge.edit { background: #dcfce7; color: #166534; }
.badge.readonly { background: #f1f5f9; color: #64748b; }

.editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 14px;
}

.editor-toolbar h2 {
  margin: 0;
  font-size: 21px;
}

.editor-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-btn {
  border: 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  background: #eff6ff;
  color: #1d4ed8;
}

.small-btn.save {
  background: #16a34a;
  color: #fff;
}

.small-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 5px solid #f97316;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.notice b {
  display: block;
  color: #9a3412;
  margin-bottom: 5px;
}

.notice span {
  display: block;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.5;
}

.code-editor {
  width: 100%;
  min-height: calc(100vh - 430px);
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  outline: none;
  font-family: Consolas, Monaco, "NanumBarunGothic", "Malgun Gothic", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #0f172a;
  background: #ffffff;
  tab-size: 4;
}

.code-editor:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  border-radius: 14px;
}

.footer {
  color: var(--muted);
  padding: 22px 4px 4px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}

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

  .file-panel {
    height: auto;
    max-height: 460px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .page-shell {
    display: block;
  }
}

/* EditPlus compact tree/list mode */
.editplus-layout {
  grid-template-columns: 330px minmax(0, 1fr);
}

.file-panel {
  padding: 12px;
}

.path-box {
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: 10px;
}

.path-box .label {
  display: none;
}

.path-text {
  font-size: 12px;
  line-height: 1.25;
}

.file-list {
  gap: 0;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.file-btn.compact {
  width: 100%;
  height: 26px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #ffffff;
  border-radius: 0;
  padding: 0 8px;
  text-align: left;
  cursor: pointer;
  font-family: "NanumBarunGothic", "Nanum Barun Gothic", "Naver Barun Gothic", "Malgun Gothic", Arial, sans-serif;
}

.file-btn.compact:last-child {
  border-bottom: 0;
}

.file-btn.compact:hover {
  background: #eef6ff;
}

.file-btn.compact.active {
  background: #dbeafe;
}

.file-btn.compact.dir {
  background: #fffdf4;
}

.file-btn.compact.dir:hover {
  background: #fff7d6;
}

.file-btn.compact.dir.active {
  background: #fde68a;
}

.file-icon {
  font-size: 15px;
  line-height: 1;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.file-kind {
  color: #64748b;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.file-btn.compact.dir .file-name {
  color: #1e293b;
  font-weight: 800;
}

.file-btn.compact .top,
.file-btn.compact b,
.file-btn.compact > span:not(.file-icon):not(.file-name):not(.file-kind),
.file-btn.compact .badge {
  display: none;
}

.file-panel::-webkit-scrollbar,
.code-editor::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.file-panel::-webkit-scrollbar-thumb,
.code-editor::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.file-panel::-webkit-scrollbar-track,
.code-editor::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.editor-panel {
  padding: 18px;
}

.editor-toolbar {
  padding-bottom: 12px;
  margin-bottom: 10px;
}

.editor-toolbar h2 {
  font-size: 19px;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 10px;
}

.code-editor {
  min-height: calc(100vh - 390px);
  font-size: 13px;
  line-height: 1.55;
}

.quick-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}

.quick-btn {
  border: 1px solid #d9e2ef;
  background: #ffffff;
  color: #1e293b;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.quick-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.search-box {
  margin-bottom: 8px;
}

.search-box input {
  width: 100%;
  height: 32px;
  border: 1px solid #d9e2ef;
  border-radius: 9px;
  padding: 0 10px;
  outline: none;
  font-size: 13px;
}

.search-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.file-panel {
  height: calc(100vh - 205px);
}

.file-btn.compact {
  height: 23px;
  grid-template-columns: 22px minmax(0, 1fr) 38px;
  padding: 0 7px;
}

.file-name {
  font-size: 12px;
  font-weight: 700;
}

.file-kind {
  font-size: 10px;
}

.file-icon {
  font-size: 13px;
}

.editor-panel {
  min-height: calc(100vh - 205px);
}

.code-editor {
  min-height: calc(100vh - 365px);
}

/* AICS dual home links */
.aics-dual-home {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 52px;
  margin: 0 0 22px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.aics-home-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: #ffffff !important;
  line-height: 1.1;
  border-right: 1px solid rgba(255,255,255,0.18);
  background: #1d4ed8;
}

.aics-home-btn:last-child {
  border-right: 0;
}

.aics-home-btn:hover {
  color: #ffffff !important;
  background: #2563eb;
}

.aics-home-new {
  background: #0f766e;
}

.aics-home-new:hover {
  background: #0d9488;
}

.aics-home-main {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.aics-home-sub {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.92;
}


