/* ===== 숲사이 펜션 관리 시스템 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
*:not(input):not(textarea):not(select):not([contenteditable="true"]) { caret-color: transparent; }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #1a472a;
    color: #fff;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar .logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #a8d5ba;
}

.sidebar .logo small {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.sidebar nav {
    flex: 1;
    padding: 16px 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.12);
    color: #a8d5ba;
    border-left-color: #a8d5ba;
    font-weight: 500;
}

.sidebar nav a .icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar .sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar .sidebar-footer a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
}

.sidebar .sidebar-footer a:hover {
    color: #fff;
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a472a;
}

.page-header p {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* ===== Dashboard Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.green::before { background: #2d8a56; }
.stat-card.blue::before { background: #3b82f6; }
.stat-card.orange::before { background: #f59e0b; }
.stat-card.red::before { background: #ef4444; }
.stat-card.purple::before { background: #8b5cf6; }

.stat-card .stat-label {
    font-size: 13px;
    color: #888;
    font-weight: 400;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-card .stat-unit {
    font-size: 14px;
    font-weight: 400;
    color: #888;
    margin-left: 4px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: #1a472a;
    color: #fff;
}
.btn-primary:hover { background: #2d6b3f; }

.btn-success {
    background: #2d8a56;
    color: #fff;
}
.btn-success:hover { background: #24713f; }

.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-secondary {
    background: #e5e7eb;
    color: #555;
}
.btn-secondary:hover { background: #d1d5db; }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #2d8a56;
    box-shadow: 0 0 0 3px rgba(45, 138, 86, 0.1);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ===== Tables ===== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: #f8f9fb;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-align: center;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    text-align: center;
}

table tbody tr:hover {
    background: #fafbfc;
}

td.text-right { text-align: right !important; }
.text-center { text-align: center; }

.amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.amount.income { color: #2d8a56; }
.amount.expense { color: #ef4444; }

/* ===== Calendar ===== */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-nav .month-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a472a;
    min-width: 160px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.calendar-grid .day-header {
    background: #1a472a;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

.calendar-grid .day-cell {
    background: #fff;
    min-height: 120px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-grid .day-cell:hover {
    background: #f0fdf4;
}

.calendar-grid .day-cell.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-grid .day-cell.today {
    background: #f0fdf4;
}

.calendar-grid .day-cell.today .day-number {
    background: #2d8a56;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid .day-cell .day-number {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid .day-cell.sunday .day-number { color: #ef4444; }
.calendar-grid .day-cell.saturday .day-number { color: #3b82f6; }

.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.day-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e8f5e9;
    color: #1a472a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-event.cleaned {
    background: #dbeafe;
    color: #1e40af;
}

.cleaning-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 14px;
    opacity: 0.7;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== Login ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a472a 0%, #2d6b3f 50%, #a8d5ba 100%);
}

.login-box {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
}

.login-box h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a472a;
    margin-bottom: 4px;
}

.login-box .subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box .form-group {
    text-align: left;
}

.login-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
    margin-top: 8px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== Priority badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-high { background: #fef2f2; color: #dc2626; }
.badge-normal { background: #f0fdf4; color: #2d8a56; }
.badge-low { background: #f8f9fb; color: #888; }

.badge-done { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fff7ed; color: #ea580c; }

/* ===== Checkbox style ===== */
.check-box {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2d8a56;
}

/* ===== Kerosene gauge ===== */
.gauge-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #2d8a56, #a8d5ba);
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    min-width: 40px;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #aaa;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== Filters ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
}

/* ===== Delete confirm ===== */
.delete-form {
    display: inline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    .sidebar .logo h1, .sidebar .logo small,
    .sidebar nav a span {
        display: none;
    }
    .sidebar nav a {
        justify-content: center;
        padding: 14px;
    }
    .sidebar nav a .icon {
        font-size: 20px;
    }
    .main-content {
        margin-left: 60px;
        padding: 20px 16px;
    }
    .calendar-grid .day-cell {
        min-height: 80px;
        padding: 4px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
