/* Quicken-style light UI shell */

:root {
  --bg: #ffffff;
  --bg-muted: #f5f5f5;
  --text: #0a0a0a;
  --text-muted: #6b7280;
  --accent: #4d3df7;
  --border: #e5e7eb;
  --radius-card: 20px;
  --radius-pill: 9999px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  /* dark vars prepared, unused */
  --dark-bg: #0f0f10;
  --dark-text: #f5f5f5;
}

body {
  background: var(--bg-muted);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, sans-serif;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 72px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
}
.sidebar-link {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); text-decoration: none;
}
.sidebar-link.active, .sidebar-link:hover {
  background: var(--bg-muted); color: var(--accent);
}
.main-panel { flex: 1; padding: 1.5rem; }
.card {
  border: none; border-radius: var(--radius-card);
  box-shadow: var(--shadow); background: var(--bg);
}
.card-header {
  background: transparent; color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.btn { border-radius: var(--radius-pill); font-weight: 600; border: none; }
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover { background: #222; color: #fff; }
.btn-secondary { background: #f0f0f0; color: #000; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -80px; top: 0; bottom: 0; z-index: 1040;
    transition: left 0.2s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-topbar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
}
@media (min-width: 769px) {
  .mobile-topbar { display: none; }
}

/* 테이블 스타일 */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: var(--bg);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-muted);
    z-index: 10;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-muted);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border);
}

.table-bordered {
    border: 1px solid var(--border);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border);
}

/* 입력 필드 스타일 */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid var(--border);
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(77, 61, 247, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* 알림 스타일 */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

/* 대시보드 카드 */
.dashboard-card {
    transition: all 0.3s ease;
    cursor: pointer;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.dashboard-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

/* 섹션 타이틀 */
.section-title {
    background: var(--bg);
    color: var(--text);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin: 2rem 0 1.5rem 0;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.section-title h4 {
    margin: 0;
    font-weight: 700;
}

/* 차트 컨테이너 */
.chart-container {
    background: var(--bg);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

/* 스크롤바 스타일 */
.table-container::-webkit-scrollbar,
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
    background: var(--bg-muted);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .table-container {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .dashboard-card {
        height: 160px;
    }

    .dashboard-icon {
        font-size: 3rem;
    }
}

/* 드롭다운 메뉴 */
.dropdown-menu {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
}

.dropdown-item:hover {
    background: var(--bg-muted);
}

/* 모달 스타일 */
.modal-content {
    border-radius: var(--radius-card);
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
}

#inappEscape {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.inapp-card {
  background: #fff; border-radius: 20px; padding: 1.5rem;
  max-width: 360px; box-shadow: var(--shadow); text-align: center;
}
.pwa-install-bar {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; padding: 0.75rem 1rem; border-radius: 9999px;
  display: flex; gap: 0.75rem; align-items: center; z-index: 1500;
}
