/* ============================================================
   ProStore Admin UI - De'Longhi Brand Design System
   Primary: #082141 (Deep Navy)
   Version: 2.0
   ============================================================ */

:root {
  --primary:        #082141;
  --primary-hover:  #0D3461;
  --primary-light:  #1B5EA6;
  --primary-pale:   #EBF3FB;
  --accent:         #1B5EA6;
  --white:          #FFFFFF;
  --bg:             #F4F6F9;
  --bg-card:        #FFFFFF;
  --text-primary:   #1A1A2E;
  --text-secondary: #5A6A7A;
  --text-muted:     #9AAABB;
  --border:         #D0DCE8;
  --border-light:   #EAF0F7;
  --success:        #2E7D32;
  --success-bg:     #E8F5E9;
  --warning:        #E65100;
  --warning-bg:     #FFF3E0;
  --danger:         #C62828;
  --danger-bg:      #FFEBEE;
  --info:           #0277BD;
  --info-bg:        #E1F5FE;
  --sidebar-width:  260px;
  --header-height:  60px;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 2px 8px rgba(8,33,65,.08);
  --shadow-md:      0 4px 16px rgba(8,33,65,.12);
  --transition:     .2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { transform: translateX(-100%); }

/* Logo */
.sidebar-logo {
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-text { font-size: 1.05rem; font-weight: 700; letter-spacing: -.2px; line-height: 1.2; }
.sidebar-logo-sub  { font-size: .68rem; color: rgba(255,255,255,.5); margin-top: 1px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 12px 0 8px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: .62rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 18px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.72);
  transition: background var(--transition), color var(--transition);
  font-size: .855rem;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  border-radius: 0;
  position: relative;
}
.nav-item:hover  { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active {
  background: rgba(255,255,255,.14);
  color: var(--white);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: #fff;
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: .95rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Footer */
.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: .8rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-user-role { font-size: .68rem; color: rgba(255,255,255,.45); }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  background: rgba(255,255,255,.06);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.sidebar-logout:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ═══════════════════════════════════════
   MAIN & HEADER
═══════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .main { margin-left: 0; }

.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(8,33,65,.05);
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-menu-btn {
  width: 34px; height: 34px;
  background: none; border: none;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: background var(--transition);
}
.header-menu-btn:hover { background: var(--bg); color: var(--primary); }
.header-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-time  { font-size: .78rem; color: var(--text-muted); min-width: 120px; text-align: right; }
.header-icon-btn {
  width: 34px; height: 34px;
  background: none; border: none;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: .95rem;
  transition: background var(--transition);
}
.header-icon-btn:hover { background: var(--bg); color: var(--primary); }
.header-icon-btn.spinning i { animation: spin .7s linear infinite; }
.header-icon-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Content */
.content { flex: 1; padding: 24px; max-width: 1400px; }

/* ═══════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kpi-icon.blue    { background: var(--primary-pale); color: var(--primary); }
.kpi-icon.green   { background: var(--success-bg);   color: var(--success); }
.kpi-icon.orange  { background: var(--warning-bg);   color: var(--warning); }
.kpi-icon.red     { background: var(--danger-bg);    color: var(--danger);  }
.kpi-icon.teal    { background: var(--info-bg);      color: var(--info);    }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--primary); line-height: 1; }
.kpi-label { font-size: .78rem; color: var(--text-secondary); margin-top: 4px; }
.kpi-sub   { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════
   CARD
═══════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
  margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: .95rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.card-body  { padding: 20px; }

/* ═══════════════════════════════════════
   SEARCH BAR / FILTER
═══════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.search-bar .form-control { width: auto; min-width: 120px; }

/* ═══════════════════════════════════════
   TABLE
═══════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  background: var(--primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  letter-spacing: .02em;
}
.table tbody tr { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
.table tbody tr:hover { background: var(--primary-pale); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody td { padding: 11px 14px; font-size: .855rem; color: var(--text-primary); vertical-align: middle; }
.table-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
/* Role */
.badge-admin    { background: var(--primary-pale); color: var(--primary); }
.badge-manager  { background: var(--info-bg);      color: var(--info);    }
.badge-promoter { background: var(--success-bg);   color: var(--success); }
/* Status */
.badge-active   { background: var(--success-bg);   color: var(--success); }
.badge-pending  { background: var(--warning-bg);   color: var(--warning); }
.badge-suspend  { background: var(--danger-bg);    color: var(--danger);  }
/* Attendance */
.badge-present  { background: var(--success-bg);   color: var(--success); }
.badge-late     { background: var(--warning-bg);   color: var(--warning); }
.badge-absent   { background: var(--danger-bg);    color: var(--danger);  }
.badge-flagged  { background: var(--danger-bg);    color: var(--danger);  }
/* Generic */
.badge-success  { background: var(--success-bg);  color: var(--success); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning); }
.badge-danger   { background: var(--danger-bg);   color: var(--danger);  }
.badge-info     { background: var(--info-bg);     color: var(--info);    }
.badge-default  { background: var(--border-light); color: var(--text-secondary); }
.badge-primary  { background: var(--primary-pale); color: var(--primary); }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: .845rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-hover); box-shadow: 0 3px 10px rgba(8,33,65,.28); transform: translateY(-1px); }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-pale); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #B71C1C; }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { background: #1B5E20; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-warning:hover  { background: #BF360C; }
.btn-ghost    { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.w-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════
   FORM
═══════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .855rem;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,94,166,.14); }
.form-control::placeholder { color: var(--text-muted); }
.form-hint  { font-size: .73rem; color: var(--text-muted);  margin-top: 4px; }
.form-error { font-size: .73rem; color: var(--danger);       margin-top: 4px; }
select.form-control { cursor: pointer; appearance: auto; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: .85rem;
  pointer-events: none;
}
.form-control-icon { padding-left: 34px; }

/* ═══════════════════════════════════════
   PAGINATION
═══════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
}
.pagination button {
  min-width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-primary);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.pagination button:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-pale); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,33,65,.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  animation: slideUp .2s ease;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; background: var(--white);
  z-index: 1;
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg);
  border-radius: 8px;
  cursor: pointer; font-size: 1rem;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-body { padding: 28px 28px; }
.modal-body .form-group:last-child { margin-bottom: 0; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ═══════════════════════════════════════
   TAB BAR
═══════════════════════════════════════ */
.tab-bar {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  padding: 9px 20px;
  border: none; background: none;
  font-size: .88rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--primary); background: var(--primary-pale); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-pale); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff;
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  position: absolute; top: 4px; right: -4px;
}

/* ═══════════════════════════════════════
   INFO BANNER
═══════════════════════════════════════ */
.info-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--primary-pale);
  border: 1px solid #c5d9f0;
  border-radius: var(--radius);
  color: var(--primary);
  font-size: .88rem;
  line-height: 1.5;
}
.info-banner i { font-size: 1rem; flex-shrink: 0; }

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 260px; max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
  border-left: 3px solid var(--primary);
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight .25s ease;
  pointer-events: all;
  font-size: .845rem;
  transition: opacity .3s, transform .3s;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

/* ═══════════════════════════════════════
   LOADING & EMPTY STATE
═══════════════════════════════════════ */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.loading-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  gap: 14px;
  color: var(--text-muted);
}
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.6rem; margin-bottom: 12px; opacity: .4; display: block; }
.empty-state p { font-size: .9rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════
   STATUS COLORS
═══════════════════════════════════════ */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #082141 0%, #0D3461 60%, #1B5EA6 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%; max-width: 390px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  position: relative;
  z-index: 1;
}
.login-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.login-brand-icon {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
  flex-shrink: 0;
}
.login-brand-title { font-size: 1.3rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.login-brand-sub   { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.login-title    { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login-subtitle { font-size: .82rem; color: var(--text-secondary); margin-bottom: 22px; }
.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(198,40,40,.2);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: .82rem;
  margin-bottom: 14px;
}
.login-footer-note {
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 18px;
}

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeIn      { from { opacity: 0; }               to { opacity: 1; } }
@keyframes slideUp     { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight{ from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin        { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   UTILITY
═══════════════════════════════════════ */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-sm   { font-size: .8rem; }
.text-xs   { font-size: .72rem; }
.fw-600    { font-weight: 600; }
.fw-700    { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }

/* Alert box */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .845rem;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(198,40,40,.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(230,81,0,.2); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(2,119,189,.2); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(46,125,50,.2); }

/* Section heading */
.section-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}

/* Detail list */
.detail-list { list-style: none; }
.detail-list li {
  display: flex; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .855rem;
}
.detail-list li:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); min-width: 90px; flex-shrink: 0; }
.detail-value { color: var(--text-primary); font-weight: 500; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .header { padding: 0 14px; }
  .content { padding: 12px; }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
}
@media (max-width: 900px) {
  .sidebar-overlay.show { display: block; }
}

/* ── Quill 에디터 커스텀 스타일 */
#quillEditor {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  overflow: visible;
}
#quillEditor .ql-editor {
  min-height: 420px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  padding: 20px 24px;
}
#quillEditor .ql-editor img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
  cursor: pointer;
  display: inline-block;
}
#quillEditor .ql-editor p { margin-bottom: 6px; }
#quillEditor .ql-editor h1 { font-size: 2em; font-weight: 700; margin-bottom: 10px; }
#quillEditor .ql-editor h2 { font-size: 1.5em; font-weight: 700; margin-bottom: 8px; }
#quillEditor .ql-editor h3 { font-size: 1.25em; font-weight: 600; margin-bottom: 6px; }

/* 툴바 */
.ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 12px 12px 0 0 !important;
  background: var(--bg);
  padding: 10px 14px !important;
  flex-wrap: wrap;
}
.ql-container.ql-snow {
  border: none !important;
  font-family: inherit;
}
.ql-toolbar.ql-snow .ql-formats { margin-right: 10px; margin-bottom: 2px; }

/* 아이콘 색상 */
.ql-snow .ql-picker                             { color: var(--text); }
.ql-snow .ql-stroke                             { stroke: var(--text-muted); }
.ql-snow .ql-fill                               { fill:   var(--text-muted); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill   { fill:   var(--primary); }

/* 폰트 사이즈 드롭다운 — 너비 확보 */
.ql-snow .ql-size.ql-picker { width: 90px; }
.ql-snow .ql-size .ql-picker-label::before { content: attr(data-value) !important; }
.ql-snow .ql-size .ql-picker-item[data-value]::before { content: attr(data-value) !important; }
/* 사이즈 드롭다운 목록 */
.ql-snow .ql-size .ql-picker-options {
  min-width: 90px;
  max-height: 260px;
  overflow-y: auto;
}
/* 각 폰트 사이즈 미리보기 */
.ql-snow .ql-size .ql-picker-item[data-value="8px"]  { font-size:  8px; line-height:1.6; }
.ql-snow .ql-size .ql-picker-item[data-value="10px"] { font-size: 10px; line-height:1.6; }
.ql-snow .ql-size .ql-picker-item[data-value="12px"] { font-size: 12px; line-height:1.6; }
.ql-snow .ql-size .ql-picker-item[data-value="14px"] { font-size: 14px; line-height:1.6; }
.ql-snow .ql-size .ql-picker-item[data-value="16px"] { font-size: 16px; line-height:1.5; }
.ql-snow .ql-size .ql-picker-item[data-value="18px"] { font-size: 18px; line-height:1.5; }
.ql-snow .ql-size .ql-picker-item[data-value="20px"] { font-size: 20px; line-height:1.4; }
.ql-snow .ql-size .ql-picker-item[data-value="24px"] { font-size: 24px; line-height:1.4; }
.ql-snow .ql-size .ql-picker-item[data-value="28px"] { font-size: 28px; line-height:1.3; }
.ql-snow .ql-size .ql-picker-item[data-value="32px"] { font-size: 32px; line-height:1.3; }
.ql-snow .ql-size .ql-picker-item[data-value="36px"] { font-size: 36px; line-height:1.2; }
.ql-snow .ql-size .ql-picker-item[data-value="42px"] { font-size: 42px; line-height:1.2; }
.ql-snow .ql-size .ql-picker-item[data-value="48px"] { font-size: 48px; line-height:1.1; }
.ql-snow .ql-size .ql-picker-item[data-value="56px"] { font-size: 56px; line-height:1.1; }
.ql-snow .ql-size .ql-picker-item[data-value="64px"] { font-size: 64px; line-height:1.1; }
.ql-snow .ql-size .ql-picker-item[data-value="72px"] { font-size: 72px; line-height:1.0; }

/* 에디터 내 이미지 – 클릭 가능 커서 */
.ql-editor img {
  cursor: pointer;
  max-width: 100%;
}

/* ── flatpickr 달력 커스텀 스타일 */
.flatpickr-calendar {
  font-family: inherit !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.15) !important;
  border: 1px solid var(--border) !important;
  overflow: hidden;
}
.flatpickr-months {
  background: var(--primary) !important;
  border-radius: 12px 12px 0 0 !important;
  padding: 6px 0 !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year {
  color: #fff !important;
  fill: #fff !important;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #fff !important;
  fill: #fff !important;
  padding: 8px 12px !important;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover { opacity: .75; }
.flatpickr-weekdays { background: #f0f4ff !important; }
span.flatpickr-weekday {
  color: var(--primary) !important;
  font-weight: 600 !important;
  font-size: .8rem !important;
}
.flatpickr-day {
  border-radius: 8px !important;
  color: var(--text) !important;
  font-size: .88rem !important;
}
.flatpickr-day:hover {
  background: #e8f0fe !important;
  border-color: transparent !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.flatpickr-day.today {
  border-color: var(--primary) !important;
  font-weight: 700 !important;
}
.flatpickr-day.today:hover {
  background: var(--primary) !important;
  color: #fff !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: #ccc !important;
}
/* 시간 선택 영역 */
.flatpickr-time {
  border-top: 1px solid var(--border) !important;
  background: var(--bg) !important;
  height: 44px !important;
}
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator {
  color: var(--text) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus {
  background: #e8f0fe !important;
}
.numInputWrapper span.arrowUp,
.numInputWrapper span.arrowDown {
  border-color: rgba(0,0,0,.1) !important;
}
/* 지우기 버튼 (x) */
.flatpickr-input ~ .flatpickr-clear-btn {
  display: none;
}
