/* WOOSUNG AI ERP 전문 테마 v4.1 - 3버튼 대시보드 버전 */
:root {
    --main-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --border-color: #334155;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --green: #10b981;
    --table-head: #1e293b;
    --slate-dark: #f8fafc;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-wrapper {
    width: 100%;
    max-width: 1100px;
    padding: 40px 20px;
}

/* Header Section */
.erp-header {
    text-align: center;
    margin-bottom: 50px;
}

.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-box {
    background: var(--primary);
    color: #fff; width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; border-radius: 6px; font-size: 24px;
}

.logo-text { font-size: 28px; font-weight: 800; color: var(--slate-dark); letter-spacing: -0.5px; }
.header-subtitle { color: var(--text-sub); font-size: 14px; margin: 0; }

/* 3-Button Grid */
.button-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9);
}

.card-icon { font-size: 50px; margin-bottom: 20px; }
.action-card h3 { font-size: 20px; font-weight: 700; margin: 0 0 10px; color: var(--slate-dark); }
.action-card p { font-size: 13px; color: var(--text-sub); margin: 0; }

/* Status Bar */
.erp-status-bar {
    margin-top: 60px;
    text-align: center;
}
.erp-status-text { font-size: 14px; color: var(--text-sub); margin-top: 10px; }

/* Modal & Content Design */
.modal {
    display: none;
    position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content.erp-modal {
    background: #0f172a;
    width: 95%; max-width: 1400px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: #1e293b;
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.card-header h3 { font-size: 18px; font-weight: 600; margin: 0; }
.close-btn { cursor: pointer; font-size: 28px; line-height: 1; opacity: 0.8; transition: 0.2s; }
.close-btn:hover { opacity: 1; transform: scale(1.1); }

.ledger-body-erp, .manual-form-erp {
    padding: 30px;
    overflow-y: auto;
}

/* ERP Table & Form Components */
.table-container-erp {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.erp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.erp-table th {
    background: var(--table-head); padding: 14px; text-align: left;
    color: var(--primary); border-bottom: 2px solid var(--primary);
    position: sticky; top: 0;
}
.erp-table td { padding: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.erp-table tr:hover { background-color: rgba(30, 41, 59, 0.6); }

.shortcut-section-erp { margin-bottom: 20px; padding: 15px; background: rgba(30, 41, 59, 0.4); border-radius: 8px; border: 1px solid var(--border-color); }
.days-grid-erp { display: flex; flex-wrap: wrap; gap: 12px; }

.day-dot {
    width: 85px; height: 85px; border-radius: 12px;
    border: 1px solid var(--border-color); background: rgba(30, 41, 59, 0.5);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    position: relative; /* 삭제 버튼 배치를 위해 */
}

.btn-delete-session {
    position: absolute; top: -8px; right: -8px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #ef4444; color: #fff; border: 2px solid #fff;
    font-size: 14px; font-weight: bold; display: flex; 
    align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.btn-delete-session:hover { background: #b91c1c; transform: scale(1.1); }

.day-dot:hover { border-color: var(--primary); transform: translateY(-3px); }
.day-dot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.day-dot.selected * { color: #fff !important; }
.day-dot .dot-time { font-size: 14px; font-weight: 700; }
.day-dot .dot-mfr { font-size: 11px; color: var(--primary); width: 65px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; }
.day-dot .dot-date { font-size: 10px; opacity: 0.6; }

/* AI Log View Style */
.ai-log-container { margin-top: 25px; text-align: left; }
.ai-log-container label { font-size: 13px; font-weight: 700; color: var(--slate-dark); margin-bottom: 8px; display: block; }

.erp-log-view {
    height: 120px; background: #000; color: #adff2f;
    padding: 12px; border-radius: 6px; font-family: 'Consolas', monospace;
    font-size: 12px; line-height: 1.5; overflow-y: auto;
    border: 1px solid #334155;
}

/* Buttons & Forms */
.btn-erp { padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; }
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-hover); }
.btn-large { width: 100%; padding: 15px; font-size: 16px; margin-top: 20px; }

.erp-form-row { margin-bottom: 20px; }
.erp-form-row label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--slate-dark); }
.erp-select, .erp-input {
    width: 100%; padding: 12px; border: 1px solid var(--border-color);
    border-radius: 6px; font-size: 15px;
    background: #1e293b; color: var(--text-main);
}
.erp-checklist-wrapper {
    height: 350px; overflow-y: auto; border: 1px solid var(--border-color);
    border-radius: 6px; margin-top: 10px; padding: 10px; background: #0f172a;
}

/* Progress bar */
.erp-progress { width: 300px; height: 8px; background: #e2e8f0; margin: 15px auto; border-radius: 4px; overflow: hidden; }
.erp-progress-bar { width: 0%; height: 100%; background: var(--primary); transition: width 0.3s; }

@media (max-width: 800px) {
    .button-grid-three { grid-template-columns: 1fr; }
    .action-card { padding: 30px 15px; }
}

/* Inline Calendar Styles */
.erp-inline-calendar {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    background: #1e293b;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.flatpickr-calendar.inline {
    width: 100% !important;
    max-width: 100% !important;
    background: transparent;
    box-shadow: none;
}
.flatpickr-innerContainer, .flatpickr-rContainer, .flatpickr-days {
    width: 100% !important;
}
.dayContainer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
}
span.flatpickr-weekday {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #cbd5e1 !important;
}

.flatpickr-day {
    position: relative;
    height: auto;
    min-height: 80px;
    flex-basis: 14.28% !important;
    max-width: 14.28% !important;
    width: 14.28% !important;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 24px !important;
    font-weight: bold !important;
}
.cal-mfr-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0;
    margin-left: 6px;
    gap: 6px;
    width: calc(100% - 20px);
}
.cal-mfr-item {
    display: flex;
    align-items: center;
    width: auto;
}
.cal-mfr-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}
.cal-mfr-text {
    font-size: 13px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}
