    :root {
      --bg-main:  #1c2228;
      --bg-sub:   #252b30;
      --bg-card:  #323841;
      --focus:    #e6b802;
      --focus2:   #899e2e;
      --border:   #323841;
      --text-primary: #c6cdc6;
      --text-muted:   #9e9e9e;
      --sidebar-w: 240px;
      --header-h:  60px;
      --red:       #ef4444;
      --green:     #22c55e;
      --blue:      #3b82f6;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body { font-family: 'Noto Sans', sans-serif; background: var(--bg-main); color: var(--text-primary); min-height: 100vh; display: flex; }
    a { color: inherit; text-decoration: none; }
    ul { list-style: none; }
    button { cursor: pointer; font-family: inherit; }
    input, select, textarea { font-family: inherit; }

    /* ══ SIDEBAR ══════════════════════════════════════════ */
    #sidebar {
      width: var(--sidebar-w);
      min-height: 100vh;
      background: var(--bg-sub);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      position: fixed; top: 0; left: 0; bottom: 0;
      z-index: 200;
      transition: transform .3s;
    }
    .sidebar-logo {
      display: flex; align-items: center; gap: 10px;
      padding: 20px 20px 18px;
      border-bottom: 1px solid var(--border);
    }
    .logo-mark {
      width: 30px; height: 30px; background: var(--focus);
      border-radius: 6px; display: flex; align-items: center;
      justify-content: center; font-weight: 900; font-size: 18px; color: #1c2228;
      flex-shrink: 0;
    }
    .sidebar-logo-text { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
    .sidebar-logo-text span { color: #fff; }
    .sidebar-badge {
      margin-left: auto; background: var(--focus2); color: #fff;
      font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
      letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
    }

    .sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
    .nav-group-label {
      font-size: 12px; font-weight: 700; letter-spacing: .12em;
      text-transform: uppercase; color: #4a5260;
      padding: 16px 20px 6px;
    }
    .nav-item {
      display: flex; align-items: center; gap: 12px;
      padding: 8px 20px; font-size: 14px; font-weight: 500;
      color: var(--text-muted); border-radius: 0; cursor: pointer;
      transition: color .2s, background .2s;
      position: relative;
    }
    .nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
    .nav-item.active {
      color: var(--focus); background: rgba(230,184,2,.08);
      font-weight: 700;
    }
    .nav-item.active::before {
      content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
      width: 3px; background: var(--focus); border-radius: 0 2px 2px 0;
    }
    .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
    .nav-item.has-submenu { position: relative; }
    .submenu-chevron { width: 14px!important; height: 14px!important; margin-left: auto; transition: transform .25s; }
    .nav-item.has-submenu.open .submenu-chevron { transform: rotate(180deg); }
    .submenu {
      max-height: 0; overflow: hidden; transition: max-height .25s ease;
      background: rgba(0,0,0,.12);
    }
    .submenu.open { max-height: 200px; }
    .nav-sub-item {
      padding: 7px 20px 7px 48px; font-size: 13px; color: var(--text-muted);
      cursor: pointer; transition: color .2s, background .2s;
    }
    .nav-sub-item:hover { color: #fff; background: rgba(255,255,255,.04); }
    .nav-sub-item.active { color: var(--focus); font-weight: 700; }
    .nav-sub-item::before { content: '·'; margin-right: 8px; }
    .nav-badge {
      margin-left: auto; background: var(--red); color: #fff;
      font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
      min-width: 18px; text-align: center;
    }

    .sidebar-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border);
    }
    .admin-info {
      display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
    }
    .admin-avatar {
      width: 34px; height: 34px; border-radius: 50%;
      background: var(--focus); display: flex; align-items: center;
      justify-content: center; font-weight: 800; font-size: 16px;
      color: #1c2228; flex-shrink: 0;
    }
    .admin-name { font-size: 15px; font-weight: 700; color: #fff; }
    .admin-role { font-size: 14px; color: var(--text-muted); }
    .btn-logout {
      width: 100%; padding: 9px; background: transparent;
      border: 1px solid var(--border); color: var(--text-muted);
      border-radius: 8px; font-size: 14px; font-weight: 600;
      transition: border-color .2s, color .2s;
    }
    .btn-logout:hover { border-color: var(--red); color: var(--red); }

    /* ══ TOPBAR ══════════════════════════════════════════ */
    #topbar {
      position: fixed; top: 0; left: var(--sidebar-w); right: 0;
      height: var(--header-h); background: var(--bg-sub);
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 32px; z-index: 100;
    }
    .topbar-title { font-size: 18px; font-weight: 700; color: #fff; }
    .topbar-right { display: flex; align-items: center; gap: 16px; }
    .topbar-btn {
      background: none; border: none; color: var(--text-muted);
      padding: 6px; border-radius: 6px; transition: color .2s;
    }
    .topbar-btn:hover { color: var(--focus); }
    .topbar-btn svg { width: 18px; height: 18px; display: block; }

    /* ══ CONTENT ══════════════════════════════════════════ */
    #content {
      margin-left: var(--sidebar-w);
      margin-top: var(--header-h);
      padding: 32px;
      min-height: calc(100vh - var(--header-h));
      width: calc(100% - var(--sidebar-w));
    }

    /* ══ SECTIONS ══════════════════════════════════════════ */
    .section { display: none; }
    .section.active { display: block; }

    /* ══ CARDS / GRID ══════════════════════════════════════ */
    .card {
      background: var(--bg-sub); border: 1px solid var(--border);
      border-radius: 12px; padding: 24px;
    }
    .card-title {
      font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 18px;
      display: flex; align-items: center; gap: 8px;
    }
    .card-title svg { width: 16px; height: 16px; stroke: var(--focus); }

    /* 통계 그리드 */
    .stat-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
      margin-bottom: 24px;
    }
    .stat-card {
      background: var(--bg-sub); border: 1px solid var(--border);
      border-radius: 12px; padding: 20px 22px;
    }
    .stat-label { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
    .stat-val { font-size: 30px; font-weight: 800; color: #fff; line-height: 1; }
    .stat-sub { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
    .stat-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-top: 8px; }
    .stat-badge.up { background: rgba(34,197,94,.12); color: var(--green); }
    .stat-badge.down { background: rgba(239,68,68,.12); color: var(--red); }

    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }

    /* ══ TABLE ══════════════════════════════════════════════ */
    .tbl-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 15px; }
    thead th {
      text-align: left; padding: 10px 14px; font-size: 14px;
      font-weight: 700; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: .06em; border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(50,56,65,.6); vertical-align: middle; }
    tbody tr:last-child td { border-bottom: none; }
    tbody tr:hover td { background: rgba(255,255,255,.02); }
    .badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
      white-space: nowrap;
    }
    .badge-green { background: rgba(34,197,94,.12); color: var(--green); }
    .badge-yellow { background: rgba(230,184,2,.12); color: var(--focus); }
    .badge-red { background: rgba(239,68,68,.12); color: var(--red); }
    .badge-blue { background: rgba(59,130,246,.12); color: var(--blue); }
    .badge-gray { background: rgba(156,163,175,.1); color: #9ca3af; }

    /* ══ CUSTOMER ACCORDION ══════════════════════════════════ */
    .cust-row { cursor: pointer; transition: background .15s; }
    .cust-row:hover td { background: rgba(230,184,2,.05) !important; }
    .cust-row.open td { background: rgba(230,184,2,.07) !important; border-bottom: none; }
    .cust-chevron {
      display: inline-block; width: 20px; height: 20px; line-height: 20px;
      text-align: center; font-size: 11px; color: var(--text-muted);
      transition: transform .2s;
    }
    .cust-chevron.open { transform: rotate(90deg); color: var(--focus); }

    .cust-detail-row td { padding: 0 !important; border-bottom: 1px solid var(--border) !important; }
    .cust-acc-body {
      background: rgba(28,34,40,.8);
      border-top: 1px solid rgba(230,184,2,.2);
      padding: 18px 20px 22px;
      animation: accOpen .15s ease;
    }
    @keyframes accOpen { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

    /* 고객 정보 — 가로 카드 테이블 */
    .cust-info-table {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1px;
      background: rgba(255,255,255,.06);
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 14px;
    }
    .cust-info-cell {
      background: var(--bg-main);
      padding: 9px 14px;
      display: flex;
      align-items: center;
      overflow: hidden;
      white-space: nowrap;
    }
    .cust-info-cell.span2 { grid-column: span 2; }
    .cust-info-lbl {
      font-size: 12px; font-weight: 700; color: #C8CACB;
      text-transform: uppercase; letter-spacing: .07em;
      flex-shrink: 0;
    }
    .cust-info-lbl::after {
      content: ' /';
      font-weight: 400;
      letter-spacing: 0;
      color: #C8CACB;
      margin-right: 7px;
    }
    .cust-info-val {
      font-size: 17px; color: #C8CACB; font-weight: 600;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cust-info-val.muted { font-size: 14px; color: #C8CACB; font-weight: 400; font-family: monospace; }
    .cust-info-val.sub   { font-size: 14px; color: #C8CACB; font-weight: 400; }

    /* 관리 액션 버튼 (가로 행) */
    .cust-acc-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 18px;
    }
    .cust-act-btn {
      padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 700;
      border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text-primary); cursor: pointer;
      transition: opacity .15s;
    }
    .cust-act-btn:hover { opacity: .8; }
    .cust-act-btn.danger { background: rgba(239,68,68,.12); color: #ef4444; border-color: rgba(239,68,68,.3); }
    .cust-act-btn.warn   { background: rgba(230,184,2,.1);  color: var(--focus); border-color: rgba(230,184,2,.25); }
    .cust-act-btn.success{ background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.3); }
    .cust-act-btn.info   { background: rgba(59,130,246,.1); color: #60a5fa;  border-color: rgba(59,130,246,.3); }

    /* 결제 히스토리 */
    .cust-acc-hist { border-top: 1px solid rgba(255,255,255,.07); padding-top: 16px; }
    .cust-hist-title {
      font-size: 14px; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px;
    }
    .cust-hist-table { width: 100%; border-collapse: collapse; font-size: 14px; }
    .cust-hist-table th {
      text-align: left !important; padding-top: 6px !important; padding-bottom: 6px !important;
      padding-left: 14px !important; padding-right: 14px !important;
      font-size: 13px; font-weight: 700;
      color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
      border-bottom: 1px solid rgba(255,255,255,.08);
    }
    .cust-hist-table td { padding-top: 9px !important; padding-bottom: 9px !important; padding-left: 14px !important; padding-right: 14px !important; text-align: left !important; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
    .cust-hist-table tr:last-child td { border-bottom: none; }

    /* ══ FORM CONTROLS ══════════════════════════════════════ */
    .form-row { margin-bottom: 18px; }
    .form-row label { display: block; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
    .form-row input, .form-row select, .form-row textarea {
      width: 100%; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; padding: 10px 14px; color: #fff; font-size: 15px; outline: none;
      transition: border-color .2s;
    }
    .form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--focus); }
    .form-row input::placeholder { color: #4a5260; }
    .form-row textarea { resize: vertical; min-height: 100px; }
    .form-row select option { background: var(--bg-card); }
    .form-note { font-size: 14px; color: var(--text-muted); margin-top: 5px; }
    .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

    .btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 22px; border: none; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .2s; }
    .btn-primary { background: var(--focus); color: #1c2228; }
    .btn-primary:hover { opacity: .88; }
    .btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
    .btn-secondary:hover { border-color: var(--focus); color: var(--focus); }
    .btn-danger { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
    .btn-danger:hover { background: rgba(239,68,68,.2); }
    .btn-sm { padding: 5px 12px; font-size: 14px; }
    .btn svg { width: 14px; height: 14px; }

    /* ══ LOGO UPLOAD ══════════════════════════════════════ */
    .logo-upload-wrap {
      display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px;
    }
    .logo-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 12px; padding: 24px;
    }
    .logo-card-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
    .logo-card-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
    .logo-preview {
      width: 100%; height: 80px; background: var(--bg-main);
      border: 1px dashed var(--border); border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      margin-bottom: 16px; overflow: hidden;
    }
    .logo-preview img { max-height: 60px; max-width: 100%; object-fit: contain; }
    .logo-preview-empty { font-size: 14px; color: #4a5260; }
    .upload-zone {
      border: 2px dashed var(--border); border-radius: 8px;
      padding: 20px; text-align: center; cursor: pointer;
      transition: border-color .2s; margin-bottom: 12px;
    }
    .upload-zone:hover, .upload-zone.drag { border-color: var(--focus); }
    .upload-zone svg { width: 24px; height: 24px; stroke: var(--text-muted); margin: 0 auto 8px; }
    .upload-zone p { font-size: 14px; color: var(--text-muted); }
    .upload-zone span { color: var(--focus); font-weight: 600; }
    .upload-zone input[type=file] { display: none; }
    .size-info {
      background: rgba(230,184,2,.06); border: 1px solid rgba(230,184,2,.15);
      border-radius: 6px; padding: 10px 14px; font-size: 14px; color: var(--text-muted);
      margin-bottom: 14px; line-height: 1.6;
    }
    .size-info strong { color: var(--focus); }

    /* ══ API SETTINGS ══════════════════════════════════════ */
    .api-row {
      display: flex; align-items: center; gap: 12px; padding: 14px 0;
      border-bottom: 1px solid var(--border);
    }
    .api-row:last-child { border-bottom: none; }
    .api-label { flex: 0 0 200px; }
    .api-label strong { display: block; font-size: 15px; color: #fff; margin-bottom: 2px; }
    .api-label span { font-size: 14px; color: var(--text-muted); }
    .api-input-wrap { flex: 1; position: relative; }
    .api-input-wrap input {
      width: 100%; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; padding: 9px 40px 9px 12px; color: #fff; font-size: 15px;
      outline: none; font-family: monospace; transition: border-color .2s;
    }
    .api-input-wrap input:focus { border-color: var(--focus); }
    .api-eye {
      position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
      background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px;
    }
    .api-eye:hover { color: var(--focus); }
    .api-eye svg { width: 16px; height: 16px; display: block; }
    .api-status { flex: 0 0 80px; text-align: right; }

    /* ══ WEBHOOK LOG ══════════════════════════════════════ */
    .wh-filter { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
    .wh-filter select, .wh-filter input {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; padding: 8px 12px; color: #fff; font-size: 15px; outline: none;
    }
    .payload-btn { background: none; border: none; color: var(--focus); font-size: 14px; cursor: pointer; }
    .payload-btn:hover { text-decoration: underline; }
    .modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.7); z-index: 1000;
      align-items: center; justify-content: center;
    }
    .modal-overlay.open { display: flex; }
    .modal-box {
      background: var(--bg-sub); border: 1px solid var(--border);
      border-radius: 14px; padding: 28px; width: 90%; max-width: 640px;
      max-height: 80vh; overflow-y: auto;
    }
    .modal-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
    .modal-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; }
    .modal-close:hover { color: var(--red); }
    pre { background: var(--bg-card); border-radius: 8px; padding: 16px; font-size: 14px; color: #a3e6a3; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

    /* ══ MARKETING ══════════════════════════════════════════ */
    .campaign-status { display: flex; gap: 8px; margin-bottom: 20px; }
    .camp-tab { padding: 7px 16px; border-radius: 22px; background: var(--bg-card); border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
    .camp-tab.active { background: var(--focus); color: #1c2228; border-color: var(--focus); }

    /* ══ BLOG ══════════════════════════════════════════════ */
    .blog-list-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 0; border-bottom: 1px solid var(--border);
    }
    .blog-list-item:last-child { border-bottom: none; }
    .blog-item-title { font-size: 16px; color: #fff; font-weight: 600; margin-bottom: 4px; }
    .blog-item-meta { font-size: 14px; color: var(--text-muted); }
    .blog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .blog-recent-item {
      display: flex; justify-content: space-between; align-items: center;
      padding: 14px 0; border-bottom: 1px solid var(--border);
    }
    .blog-recent-item:last-child { border-bottom: none; }
    .blog-auto-tab {
      padding: 10px 20px; font-size: 13px; font-weight: 600;
      color: var(--text-muted); background: none; border: none;
      border-bottom: 2px solid transparent; cursor: pointer;
      transition: color .2s, border-color .2s;
    }
    .blog-auto-tab:hover { color: #fff; }
    .blog-auto-tab.active { color: var(--focus); border-bottom-color: var(--focus); }
    .auto-count-btn {
      width: 32px; height: 32px; border-radius: 6px;
      background: var(--bg-main); border: 1px solid var(--border);
      color: var(--text-muted); font-size: 13px; font-weight: 600;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s;
    }
    .auto-count-btn.active { background: var(--focus); color: #000; border-color: var(--focus); }

    /* ══ ADMINS ══════════════════════════════════════════════ */
    .section-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 20px;
    }
    .section-header h2 { font-size: 20px; font-weight: 800; color: #fff; }

    /* ══ CACHE MANAGEMENT ════════════════════════════════════ */
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ══ RESPONSIVE ══════════════════════════════════════════ */
    @media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 900px) {
      #sidebar { transform: translateX(-100%); }
      #sidebar.open { transform: translateX(0); }
      #content { margin-left: 0; width: 100%; }
      #topbar { left: 0; }
      .logo-upload-wrap { grid-template-columns: 1fr; }
      .grid-2 { grid-template-columns: 1fr; }
    }
    @media (max-width: 600px) {
      .stat-grid { grid-template-columns: 1fr 1fr; }
      #content { padding: 20px 16px; }
      .form-grid-2 { grid-template-columns: 1fr; }
    }
