/* =========================================
   KES Admin - Clean White Theme
   ========================================= */

/* ---- Root Variables ---- */
:root {
    --bg-page:        #f4f6f9;
    --bg-card:        #ffffff;
    --bg-sidebar:     #ffffff;
    --border-color:   #e3e6ea;
    --accent:         #2563eb;
    --accent-light:   #eff6ff;
    --text-primary:   #1e293b;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.05);
    --radius:         10px;
}

/* ---- Base ---- */
body {
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
    font-family: 'Source Sans Pro', 'Noto Sans KR', sans-serif;
}

/* ---- Navbar ---- */
.main-header.navbar {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}
.main-header .navbar-nav .nav-link {
    color: var(--text-secondary) !important;
}
.main-header .brand-link {
    border-bottom: 1px solid var(--border-color) !important;
}

/* ---- Sidebar ---- */
.main-sidebar {
    background-color: var(--bg-card) !important;
    border-right: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}
.main-sidebar .brand-link {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.main-sidebar .brand-text {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}
/* 메뉴 링크 */
.nav-sidebar .nav-link {
    color: var(--text-secondary) !important;
    border-radius: 8px !important;
    margin: 2px 8px !important;
    padding: 8px 12px !important;
    transition: background 0.15s, color 0.15s !important;
}
.nav-sidebar .nav-link:hover {
    background-color: var(--accent-light) !important;
    color: var(--accent) !important;
}
.nav-sidebar .nav-link.active {
    background-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25) !important;
}
.nav-sidebar .nav-icon {
    color: inherit !important;
    margin-right: 8px !important;
}
.nav-header {
    color: var(--text-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 12px 16px 4px !important;
}
/* 사이드바 내 사용자 패널 */
.sidebar .user-panel {
    border-bottom: 1px solid var(--border-color) !important;
}

/* ---- Content Wrapper ---- */
.content-wrapper {
    background-color: var(--bg-page) !important;
}

/* ---- Cards ---- */
.card {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
}
.card-header {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    padding: 14px 20px !important;
}
.card-title {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1rem;
}
.card-body {
    color: var(--text-primary) !important;
}

/* ---- Tables ---- */
.table {
    color: var(--text-primary) !important;
}
.table thead th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid var(--border-color) !important;
    border-top: none !important;
    color: var(--text-secondary) !important;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 12px !important;
}
.table td {
    border-top: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    padding: 10px 12px !important;
    font-size: 0.88rem;
}
.table tbody tr:hover {
    background-color: #f8fbff !important;
    cursor: pointer;
}
.table-hover tbody tr:hover {
    background-color: #f8fbff !important;
}

/* ---- Forms ---- */
.form-control {
    background-color: #fff !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 7px !important;
}
.form-control:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
}
.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}
select.form-control option {
    background-color: #fff !important;
    color: var(--text-primary) !important;
}
.input-group-text {
    background-color: #f8fafc !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* ---- Buttons ---- */
.btn-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}
.btn-outline-secondary {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
.btn-outline-secondary:hover {
    background-color: #f1f5f9 !important;
    color: var(--text-primary) !important;
}

/* ---- Status Tags & Badges ---- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tag-success  { background: #dcfce7; color: #15803d; }
.tag-warning  { background: #fef9c3; color: #a16207; }
.tag-danger   { background: #fee2e2; color: #b91c1c; }
.tag-info     { background: #dbeafe; color: #1d4ed8; }
.tag-secondary{ background: #f1f5f9; color: #64748b; }

/* ---- Pagination ---- */
.page-link {
    color: var(--accent) !important;
    border-color: var(--border-color) !important;
    background-color: #fff !important;
}
.page-item.active .page-link {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}
.page-item.disabled .page-link {
    color: var(--text-muted) !important;
}

/* ---- Section Title ---- */
.section-header {
    display: flex;
    align-items: center;
    padding: 0 0 12px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}
.section-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ---- Modals ---- */
.modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}
.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    background-color: #f8fafc !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.modal-title { color: var(--text-primary) !important; font-weight: 700; }
.modal-footer { border-top: 1px solid var(--border-color) !important; }
.close { color: var(--text-secondary) !important; }

/* ---- Notification sidebar ---- */
.notification-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 9999;
    transition: right 0.3s ease;
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
.notification-sidebar.open { right: 0; }

/* ---- Theme toggle (legacy - keep) ---- */
.theme-toggle-btn {
    display: none; /* 라이트 테마 고정 - 토글 숨김 */
}

/* ---- Abstract table row clickable hint ---- */
#abstracts-table-body tr {
    cursor: pointer;
}

/* ---- Log viewer ---- */
#log-viewer {
    background: #1e293b !important;
    color: #94a3b8 !important;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    border-radius: 8px;
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
}

/* ---- Existing event/policy table inputs ---- */
.existing-row input.form-control,
.existing-row select.form-control {
    background-color: #fff !important;
    color: var(--text-primary) !important;
}

/* ---- Remove glassmorphism card hover lift ---- */
.card:hover,
.glass-panel:hover,
.glass-box:hover {
    transform: none !important;
    box-shadow: var(--shadow-md) !important;
}

/* ---- Inline dark overrides from old HTML (compatibility) ---- */
.bg-transparent { background-color: transparent !important; }
.text-white-force { color: var(--text-primary) !important; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }