/* ═══════════════════════════════════════════════════════════
   EKP Dashboard — Modern Design System (2026)
   Based on EKP Watermelon Brand Identity
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    /* Primary (from logo) */
    --color-primary:         #A2D84A;
    --color-primary-dark:    #7BB530;
    --color-primary-light:   #C8E98A;
    --color-primary-subtle:  #eef7d9;

    /* Accent (from logo) */
    --color-accent:          #F5908E;
    --color-accent-dark:     #E06B68;
    --color-accent-light:    #FCCECE;

    /* Neutrals */
    --color-black:           #1A1A1A;
    --color-gray-dark:       #4A4A4A;
    --color-gray:            #777676;
    --color-gray-light:      #E0E0E0;
    --color-off-white:       #F5F5F5;
    --color-white:           #FFFFFF;

    /* Semantic */
    --color-success:         #A2D84A;
    --color-warning:         #F5C542;
    --color-danger:          #E06B68;
    --color-info:            #5BA4CF;

    /* Surfaces */
    --bg-body:               #F0F2F5;
    --bg-card:               #FFFFFF;
    --bg-nav:                #FFFFFF;
    --bg-sidebar:            #1A1A1A;

    /* Text */
    --text-primary:          #1A1A1A;
    --text-secondary:        #4A4A4A;
    --text-muted:            #777676;
    --text-on-primary:       #FFFFFF;
    --text-on-accent:        #FFFFFF;

    /* Borders */
    --border-color:          #E8EAED;
    --border-radius-sm:      6px;
    --border-radius-md:      10px;
    --border-radius-lg:      16px;
    --border-radius-xl:      20px;
    --border-radius-full:    9999px;

    /* Shadows */
    --shadow-xs:   0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.09);
    --shadow-xl:   0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(162, 216, 74, 0.2);

    /* Focus */
    --focus-ring:  0 0 0 3px rgba(162, 216, 74, 0.35);

    /* Spacing (8px base) */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  24px;
    --space-6:  32px;
    --space-7:  48px;
    --space-8:  64px;

    /* Transitions */
    --transition-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:  250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Nav */
    --nav-height: 64px;
}


/* ── Base Reset & Typography ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 0;
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { margin-bottom: 1rem; }

a {
    color: var(--color-primary-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-primary);
}


/* ═══════════════════════════════════════
   NAVBAR — Glass-morphism Top Bar
   ═══════════════════════════════════════ */
.navbar.ekp-navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-xs);
    padding: 0 1rem;
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: box-shadow var(--transition-base), background var(--transition-base);
}

.navbar.ekp-navbar.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand img {
    height: 42px;
    transition: transform var(--transition-fast);
}
.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Nav Links */
.ekp-navbar .nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary) !important;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.ekp-navbar .nav-link:hover,
.ekp-navbar .nav-link:focus {
    color: var(--color-primary-dark) !important;
    background: var(--color-primary-subtle);
}

/* Nav Pill Buttons (준비, 대쉬보드) */
.ekp-navbar .btn-pill {
    background: var(--color-primary);
    color: var(--color-white) !important;
    border-radius: var(--border-radius-full);
    padding: 0.4rem 1rem !important;
    font-weight: 600;
    font-size: 0.8125rem;
    border: none;
    box-shadow: 0 2px 6px rgba(162, 216, 74, 0.3);
    transition: all var(--transition-fast);
}
.ekp-navbar .btn-pill:hover {
    background: var(--color-primary-dark);
    color: var(--color-white) !important;
    box-shadow: 0 4px 12px rgba(162, 216, 74, 0.4);
    transform: translateY(-1px);
}

.ekp-navbar .btn-pill-accent {
    background: var(--color-accent);
    box-shadow: 0 2px 6px rgba(245, 144, 142, 0.3);
}
.ekp-navbar .btn-pill-accent:hover {
    background: var(--color-accent-dark);
    box-shadow: 0 4px 12px rgba(245, 144, 142, 0.4);
}

/* Dropdown Menus */
.ekp-navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
    animation: dropIn 0.2s ease;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.98);
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ekp-navbar .dropdown-item {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.ekp-navbar .dropdown-item:hover,
.ekp-navbar .dropdown-item:focus {
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
}

.ekp-navbar .dropdown-divider {
    margin: 0.35rem 0;
    border-color: var(--border-color);
}

/* Mobile Toggle */
.navbar-toggler {
    border: none !important;
    padding: 0.4rem;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}
.navbar-toggler:hover {
    background: var(--color-off-white);
}
.navbar-toggler:focus {
    box-shadow: var(--focus-ring);
}

/* User area in nav */
.ekp-user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ekp-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
}


/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */
.ekp-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
    padding-bottom: var(--space-8);
}

@media (min-width: 768px) {
    .ekp-main {
        padding: var(--space-6) var(--space-6);
    }
}


/* ═══════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════ */
.ekp-page-header {
    margin-bottom: var(--space-5);
}

.ekp-page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ekp-page-header h1 .header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, var(--color-primary-subtle), rgba(162, 216, 74, 0.15));
    font-size: 1.25rem;
}

.ekp-page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}


/* ═══════════════════════════════════════
   CARDS — Modern Dashboard Cards
   ═══════════════════════════════════════ */
.ekp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    position: relative;
    overflow: hidden;
}

.ekp-card:hover {
    box-shadow: var(--shadow-md);
}

.ekp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.ekp-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.ekp-card-title .card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
}

.ekp-card-title .card-icon.green  { background: var(--color-primary-subtle); color: var(--color-primary-dark); }
.ekp-card-title .card-icon.pink   { background: rgba(245, 144, 142, 0.12); color: var(--color-accent-dark); }
.ekp-card-title .card-icon.blue   { background: rgba(91, 164, 207, 0.12); color: var(--color-info); }
.ekp-card-title .card-icon.yellow { background: rgba(245, 197, 66, 0.12); color: #C9A200; }


/* ── Stat Cards (KPI mini cards) ── */
.ekp-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.ekp-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.ekp-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.ekp-stat-card:hover::after {
    opacity: 1;
}

.ekp-stat-card.accent::after { background: var(--color-accent); }
.ekp-stat-card.info::after   { background: var(--color-info); }
.ekp-stat-card.warning::after { background: var(--color-warning); }

.ekp-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ekp-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ekp-stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--border-radius-full);
}

.ekp-stat-change.up {
    color: var(--color-primary-dark);
    background: var(--color-primary-subtle);
}
.ekp-stat-change.down {
    color: var(--color-danger);
    background: rgba(224, 107, 104, 0.1);
}


/* ═══════════════════════════════════════
   MONTHLY SLOGAN — Modern Banner
   ═══════════════════════════════════════ */
.ekp-slogan-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--border-radius-lg);
    padding: var(--space-4) var(--space-5);
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    box-shadow: 0 4px 16px rgba(162, 216, 74, 0.25);
    position: relative;
    overflow: hidden;
}

.ekp-slogan-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.ekp-slogan-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.ekp-slogan-month {
    font-size: 1.25rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.375rem 0.875rem;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.ekp-slogan-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}


/* ═══════════════════════════════════════
   DATE SELECTOR — Clean Controls
   ═══════════════════════════════════════ */
.ekp-date-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.ekp-date-selector label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}


/* ═══════════════════════════════════════
   TABLES — Modern Data Tables
   ═══════════════════════════════════════ */
.ekp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-md);
}

table.ekp-table,
table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

table.ekp-table thead th,
.ekp-card table thead th {
    background: var(--color-primary-subtle);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.625rem 0.75rem;
    border-bottom: 2px solid var(--color-primary-light);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

table.ekp-table thead th:first-child { border-radius: var(--border-radius-sm) 0 0 0; }
table.ekp-table thead th:last-child  { border-radius: 0 var(--border-radius-sm) 0 0; }

table.ekp-table tbody td,
.ekp-card table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
    transition: background var(--transition-fast);
}

table.ekp-table tbody tr:hover td,
.ekp-card table tbody tr:hover td {
    background: rgba(162, 216, 74, 0.04);
}

table.ekp-table tbody tr:last-child td {
    border-bottom: none;
}


/* ═══════════════════════════════════════
   PROGRESS BARS — Sleek Modern Style
   ═══════════════════════════════════════ */
.progress {
    height: 8px;
    border-radius: var(--border-radius-full);
    background: var(--color-off-white);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress-bar {
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: var(--border-radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--color-warning), #d4a535);
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, var(--color-info), #3d8cb8);
}

/* Progress label */
.ekp-progress-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: right;
}


/* ═══════════════════════════════════════
   BUTTONS — Modern Design
   ═══════════════════════════════════════ */
.btn {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn:focus-visible {
    box-shadow: var(--focus-ring);
    outline: none;
}

.btn-primary,
.btn-green {
    background: var(--color-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(162, 216, 74, 0.3);
}
.btn-primary:hover,
.btn-green:hover {
    background: var(--color-primary-dark);
    color: white;
    box-shadow: 0 3px 8px rgba(162, 216, 74, 0.4);
    transform: translateY(-1px);
}

.btn-pink,
.btn-accent {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 1px 3px rgba(245, 144, 142, 0.3);
}
.btn-pink:hover,
.btn-accent:hover {
    background: var(--color-accent-dark);
    color: white;
    box-shadow: 0 3px 8px rgba(245, 144, 142, 0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--color-primary-dark);
    border: 1.5px solid var(--color-primary);
}
.btn-outline-primary:hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--color-off-white);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.3rem 0.625rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    border-radius: var(--border-radius-md);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}


/* ═══════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════ */
.form-control,
.form-select {
    font-family: "Noto Sans KR", sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--color-white);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

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

/* Small inline inputs (table cells, etc.) */
.form-control.form-control-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 4px;
}

input[type="date"],
input[type="number"] {
    font-family: "Noto Sans KR", sans-serif;
}


/* ═══════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════ */
.badge,
.ekp-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius-full);
    letter-spacing: 0.02em;
}

.badge-green  { background: var(--color-primary-subtle); color: var(--color-primary-dark); }
.badge-pink   { background: var(--color-accent-light);   color: var(--color-accent-dark); }
.badge-yellow { background: #FFF3CD;                     color: #856404; }
.badge-blue   { background: #D1ECF1;                     color: #0C5460; }
.badge-gray   { background: #EEEEEE;                     color: var(--color-gray-dark); }


/* ═══════════════════════════════════════
   ALERTS — Modern Notifications
   ═══════════════════════════════════════ */
.ekp-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-left: 4px solid transparent;
}

.ekp-alert.success { background: #EDF7D4; border-left-color: var(--color-success); }
.ekp-alert.warning { background: #FFF8E1; border-left-color: var(--color-warning); }
.ekp-alert.error   { background: #FDEDED; border-left-color: var(--color-danger); }
.ekp-alert.info    { background: #E8F4FD; border-left-color: var(--color-info); }


/* ═══════════════════════════════════════
   DAILY NOTES
   ═══════════════════════════════════════ */
.ekp-notes-area {
    margin-top: var(--space-4);
}

.ekp-notes-area textarea {
    resize: vertical;
    min-height: 80px;
}


/* ═══════════════════════════════════════
   MODALS — Clean Overlay
   ═══════════════════════════════════════ */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-5);
}

.modal-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-3) var(--space-5);
}


/* ═══════════════════════════════════════
   DATATABLES OVERRIDES
   ═══════════════════════════════════════ */
.dataTables_wrapper {
    font-size: 0.8125rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--border-radius-sm) !important;
    border: none !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--color-primary) !important;
    color: white !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-primary-subtle) !important;
    color: var(--color-primary-dark) !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
footer.ekp-footer {
    background: var(--color-white);
    border-top: 1px solid var(--border-color);
    padding: var(--space-4) 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}


/* ═══════════════════════════════════════
   ANIMATIONS & UTILITIES
   ═══════════════════════════════════════ */

/* Fade in on load */
.ekp-fadein {
    animation: fadeInUp 0.4s ease both;
}

.ekp-fadein-delay-1 { animation-delay: 0.05s; }
.ekp-fadein-delay-2 { animation-delay: 0.1s; }
.ekp-fadein-delay-3 { animation-delay: 0.15s; }
.ekp-fadein-delay-4 { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Pulse dot for live indicator */
.ekp-live-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* Skeleton loading */
.ekp-skeleton {
    background: linear-gradient(90deg, var(--color-off-white) 25%, #e8e8e8 50%, var(--color-off-white) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Utility: Gap overrides */
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }


/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-gray-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray);
}


/* ═══════════════════════════════════════
   RESPONSIVE — Mobile First Overrides
   ═══════════════════════════════════════ */
@media (max-width: 767.98px) {
    :root {
        --nav-height: 56px;
    }

    .ekp-main {
        padding: var(--space-4) var(--space-3);
    }

    .ekp-page-header h1 {
        font-size: 1.375rem;
    }

    .ekp-card {
        padding: var(--space-4);
        border-radius: var(--border-radius-md);
    }

    .ekp-slogan-banner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
        padding: var(--space-4);
    }

    .ekp-stat-value {
        font-size: 1.375rem;
    }

    /* Stack columns */
    .ekp-dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    /* Table horizontal scroll */
    .ekp-table-wrap {
        margin: 0 calc(-1 * var(--space-4));
        padding: 0 var(--space-4);
    }

    /* Full width buttons on mobile */
    .ekp-mobile-full {
        width: 100%;
    }

    /* Dropdown fullscreen on mobile */
    .navbar-collapse .dropdown-menu {
        border: none;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .ekp-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .ekp-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}


/* ═══════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════ */
@media print {
    .ekp-navbar,
    footer.ekp-footer,
    .ekp-date-selector,
    .navbar {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .ekp-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}


/* ═══════════════════════════════════════════════════════════
   BACKWARD COMPATIBILITY
   Maps legacy Bootstrap & Tailwind utility classes to the
   EKP design-system tokens so all 442 existing views render
   consistently without per-file edits.
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Legacy Bootstrap Layout ── */
.box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.btnrow {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding: var(--space-3) 0;
}

.form-group {
    margin-bottom: var(--space-4);
}

.control-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-append,
.input-group-prepend {
    display: flex;
}

.input-group-append .btn,
.input-group-prepend .btn {
    border-radius: 0;
}

.input-group-append:last-child .btn {
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.input-group-prepend:first-child .btn {
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
}

/* ── 2. Legacy Table Classes ── */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-4);
}

table.table-bordered {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

table.table-bordered thead th {
    background: var(--color-primary-subtle);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

table.table-bordered tbody td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

table.table-bordered tbody tr:hover td {
    background: rgba(162, 216, 74, 0.04);
}

table.display {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

table.display thead th {
    background: var(--color-primary-subtle);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 2px solid var(--color-primary-light);
    white-space: nowrap;
}

table.display tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

table.display tbody tr:hover td {
    background: rgba(162, 216, 74, 0.04);
}


/* ── 3. Korean Font Utility ── */
.korean-font {
    font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}


/* ── 4. Tailwind — Display & Layout ── */
.block   { display: block; }
.flex    { display: flex; }
.grid    { display: grid; }
.flex-1  { flex: 1 1 0%; }
.w-full  { width: 100%; }
.min-w-full { min-width: 100%; }

.items-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }


/* ── 5. Tailwind — Spacing ── */
.py-2 { padding-top: 0.5rem;  padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem;    padding-bottom: 1rem; }
.px-4 { padding-left: 1rem;   padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }

.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }


/* ── 6. Tailwind — Typography ── */
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }

.text-xs  { font-size: 0.75rem;  line-height: 1rem; }
.text-sm  { font-size: 0.875rem; line-height: 1.25rem; }
.text-2xl { font-size: 1.5rem;   line-height: 2rem; }

.text-left  { text-align: left; }
.uppercase  { text-transform: uppercase; }
.leading-5  { line-height: 1.25rem; }
.tracking-wider { letter-spacing: 0.05em; }
.whitespace-nowrap { white-space: nowrap; }


/* ── 7. Tailwind — Colors (mapped to EKP tokens) ── */
.text-white    { color: #fff; }
.text-gray-400 { color: var(--color-gray-light); }
.text-gray-500 { color: var(--text-muted); }
.text-gray-600 { color: var(--color-gray); }
.text-gray-700 { color: var(--text-secondary); }
.text-gray-900 { color: var(--text-primary); }
.text-red-500  { color: var(--color-danger); }

.bg-white     { background-color: var(--bg-card); }
.bg-blue-600  { background-color: var(--color-primary); }
.hover\:bg-blue-700:hover { background-color: var(--color-primary-dark); }


/* ── 8. Tailwind — Borders ── */
.border       { border: 1px solid var(--border-color); }
.border-b     { border-bottom: 1px solid var(--border-color); }
.border-gray-200 { border-color: var(--border-color); }
.border-gray-300 { border-color: var(--color-gray-light); }

.rounded-lg   { border-radius: var(--border-radius-md); }
.rounded-full { border-radius: var(--border-radius-full); }

.divide-y > * + *        { border-top: 1px solid var(--border-color); }
.divide-gray-200 > * + * { border-color: var(--border-color); }


/* ── 9. Tailwind — Shadows ── */
.shadow-sm { box-shadow: var(--shadow-sm); }


/* ── 10. Tailwind — Overflow ── */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }


/* ── 11. Tailwind — Transitions & Focus ── */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.focus\:ring-2:focus {
    box-shadow: var(--focus-ring);
    outline: none;
}

.focus\:ring-blue-500:focus {
    /* uses EKP green focus ring instead of blue */
    box-shadow: var(--focus-ring);
}

.focus\:border-transparent:focus {
    border-color: transparent;
}
