:root {
    /* Premium Modern Palette (Notion-inspired) */
    --primary: #4361ee;
    --primary-soft: #eef2ff;
    --primary-dark: #3a0ca3;
    --success: #10b981;
    --success-soft: #ecfdf5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --bg-main: #f8fafc;
    /* Lighter bg */
    --text-main: #0f172a;
    /* Darker grey-black */
    --text-muted: #64748b;

    /* Design Tokens */
    --radius-xl: 20px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-3d: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 10px 30px rgba(67, 97, 238, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans KR', -apple-system, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- Navigation --- */
.glass-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
}

.nav-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welfare-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
}

.logo-divider-v {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
}

.nav-logo-img {
    height: 28px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 0.3rem;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}

.nav-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn.active {
    background: white;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.date-display {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #eef2f6;
}

.user-name {
    font-weight: 700;
    color: var(--text-main);
}

.user-team {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.logout-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* --- Layout --- */
.content-area {
    max-width: 1600px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
    color: #1a1c2e;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 400;
}

/* --- Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 400px;
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f6;
}

.stat-box {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3d);
    border: 1px solid #f1f5f9;
    container-type: inline-size;
    /* Added for dynamic font size */
}

.stat-box .label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.stat-box h2 {
    font-size: clamp(1.2rem, 12cqw, 2.4rem);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Tables --- */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-3d);
    border: 1px solid #f1f5f9;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1.2rem;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.5rem 1.2rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 400;
    font-size: 1.15rem;
    color: #1e293b;
}

.table-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-weight: 400;
    font-size: 1.1rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.table-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: white;
}

/* --- Buttons --- */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    box-shadow: none;
    width: 100%;
}

.primary-btn.secondary:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.danger-btn {
    background: #fff;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* --- Choice Grid & Setup UI --- */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.choice-card {
    background: white;
    padding: 2.5rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.choice-card:hover {
    border-color: var(--primary);
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.05);
}

.choice-card i {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.choice-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.choice-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

.add-project-card {
    max-width: 600px;
    margin: 0 auto;
}

.add-project-card h3 {
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.input-group {
    display: flex;
    gap: 0.8rem;
}

/* --- Action Bar Groups --- */
.action-bar-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #eef2f6;
}

.action-sub-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.action-label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.action-divider {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    margin: 0 1.5rem;
}

/* --- Login Page Professional Redesign --- */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #fefeff 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
    max-width: 580px;
    /* Wider for better balance */
    padding: 4rem;
    border-radius: 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-align: center;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

/* --- Header & Icon Enhancement --- */
.header-with-icon {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-box.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.icon-box.green {
    background: #ecfdf5;
    color: #10b981;
}

.icon-box.purple {
    background: #f5f3ff;
    color: #8b5cf6;
}

.icon-box.orange {
    background: #fff7ed;
    color: #f97316;
}

.icon-box i {
    width: 24px;
    height: 24px;
}

.section-header.header-with-icon .icon-box {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.section-header.header-with-icon .icon-box i {
    width: 32px;
    height: 32px;
}

/* --- Login Page Flagship Branding --- */
.login-brand-section {
    margin-bottom: 2.5rem;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1;
}

.brand-subtitle {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2rem;
    word-break: keep-all;
}

.partner-branding {
    margin-bottom: 2.5rem;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.4s ease;
}

.partner-branding:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.partner-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.brand-divider {
    width: 1.5px;
    height: 44px;
    background: #e2e8f0;
}

.official-logo-img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.nav-logo-img {
    height: 14px;
    width: auto;
    object-fit: contain;
}

.login-title {
    font-size: 2rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.login-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 3rem;
    font-weight: 500;
}

.login-form {
    text-align: left;
}

.login-form label {
    display: block;
    font-weight: 800;
    color: #475569;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    padding-left: 0.2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 2.5rem;
}

.team-select-btn {
    padding: 1rem;
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    border-radius: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.team-select-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
}

.team-select-btn.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.1);
    font-weight: 850;
}

.login-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1.5px solid #f1f5f9;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(67, 97, 238, 0.08);
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 1.3rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #3a4ecc 100%);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 1.2rem;
    font-weight: 850;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 12px 24px -6px rgba(67, 97, 238, 0.3);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -8px rgba(67, 97, 238, 0.4);
}

.login-footer {
    display: block;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Utility */
.hidden {
    display: none !important;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Modals & Overlays --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.close-modal {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 2rem;
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #eef2f6;
}

.batch-item .name {
    flex: 1;
    font-weight: 600;
}

.batch-item .amount-input {
    width: 140px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.team-select-btn {
    padding: 1rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 1rem;
}

.team-select-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.team-select-btn.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.login-form .form-group label {
    margin-bottom: 1rem;
}

/* --- Integrated Branding --- */
.login-branding-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.welfare-logo-simple {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.welfare-logo-simple .box {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
}

.welfare-logo-simple .txt {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text-main);
}

.welfare-logo-simple .txt span {
    color: var(--primary);
}

.brand-divider {
    width: 2px;
    height: 40px;
    background: #e2e8f0;
}

.logo-divider-v {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    margin: 0 0.5rem;
}

.welfare-badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.official-logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.nav-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.org-logo {
    display: flex;
    align-items: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* --- Premium Inline Calendar (Flatpickr) --- */
.flatpickr-calendar.inline {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-day:hover {
    background: var(--primary-soft) !important;
}

.flatpickr-weekday {
    font-weight: 800 !important;
    color: var(--text-muted) !important;
}