* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: Arial, 'Noto Sans KR', sans-serif;
    background: #0f172a;
    color: #e5e7eb
}

.layout {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 240px;
    background: #020617;
    padding: 24px 16px;
    border-right: 1px solid #1e293b
}

.brand {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 28px
}

.nav {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 12px;
    margin-bottom: 8px
}

.nav.active,
.nav:hover {
    background: #1e293b;
    color: #fff
}

.content {
    flex: 1;
    padding: 28px;
    overflow: auto
}

h1 {
    margin: 0 0 20px
}

h2 {
    font-size: 18px;
    margin: 0 0 14px
}

.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2)
}

.split {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 12px;
    align-items: end
}

.grid-form.two {
    grid-template-columns: repeat(2, minmax(240px, 1fr))
}

label {
    display: block;
    color: #cbd5e1;
    font-size: 14px
}

input,
select {
    width: 100%;
    margin-top: 7px;
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 11px 12px
}

button {
    border: 0;
    background: #2563eb;
    color: white;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer
}

button:hover {
    background: #1d4ed8
}

.danger {
    background: #dc2626
}

.danger:hover {
    background: #b91c1c
}

.toolbar {
    display: flex;
    gap: 10px;
    margin: 18px 0
}

.toolbar.right {
    justify-content: flex-end
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 12px
}

.list-row.selected {
    background: #1e293b
}

.list-row a {
    color: #e5e7eb;
    text-decoration: none;
    flex: 1
}

small,
.muted {
    color: #94a3b8
}

.hidden {
    display: none
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px
}

.success {
    background: #064e3b
}

.error {
    background: #7f1d1d
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px
}

th,
td {
    border-bottom: 1px solid #263244;
    padding: 12px;
    text-align: left;
    vertical-align: middle
}

th {
    color: #93c5fd;
    font-size: 13px
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px;
    background: #020617
}

.check-card input {
    width: auto;
    margin: 0
}

.check-card span {
    display: flex;
    flex-direction: column;
    gap: 4px
}

@media(max-width:900px) {
    .layout {
        display: block
    }

    .sidebar {
        width: auto
    }

    .split,
    .grid-form,
    .grid-form.two {
        grid-template-columns: 1fr
    }
}

.bulk-upload-card {
    margin: 24px 0 18px;
    padding: 18px;
    border: 1px solid #26364d;
    border-radius: 18px;
    background: linear-gradient(180deg, #111c31 0%, #0b1220 100%)
}

.bulk-upload-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px
}

.bulk-upload-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #f8fafc
}

.bulk-upload-head p {
    margin: 0;
    color: #94a3b8;
    font-size: 14px
}

.bulk-upload-head code,
.bulk-help code {
    background: #020617;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 2px 6px;
    color: #bfdbfe
}

.format-badge {
    white-space: nowrap;
    background: #172554;
    color: #bfdbfe;
    border: 1px solid #1d4ed8;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700
}

.bulk-upload-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 1.1fr) 220px;
    gap: 14px;
    align-items: stretch
}

.custom-file {
    margin: 0;
    display: flex;
    align-items: center;
    min-height: 56px;
    border: 1px dashed #3b82f6;
    border-radius: 14px;
    background: #020617;
    overflow: hidden;
    cursor: pointer;
    transition: .15s ease
}

.custom-file:hover {
    border-color: #60a5fa;
    background: #071228
}

.custom-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.file-button {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: #2563eb;
    color: #fff;
    font-weight: 800
}

.file-name {
    flex: 1;
    padding: 0 14px;
    color: #cbd5e1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.bulk-help {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid #243244;
    border-radius: 14px;
    background: rgba(2, 6, 23, .45);
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.4
}

.bulk-help b {
    color: #e2e8f0;
    font-size: 14px
}

.bulk-submit {
    min-height: 56px;
    border-radius: 14px;
    background: #2563eb;
    font-size: 15px
}

.bulk-submit:hover {
    background: #1d4ed8
}

@media(max-width:1100px) {
    .bulk-upload-form {
        grid-template-columns: 1fr
    }

    .bulk-submit {
        width: 100%
    }

    .bulk-upload-head {
        display: block
    }

    .format-badge {
        display: inline-block;
        margin-top: 10px
    }
}


/* =========================
   works.php 전용
========================= */

.work-form {
    width: 100%;
}

.page-title-wrap {
    margin-bottom: 28px;
}

.page-title-wrap h1 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 900;
    color: #fff;
}

.page-title-wrap p {
    margin: 0;
    color: #a9bfdc;
    font-size: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    margin-bottom: 10px;
    align-items: end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: #2563eb;
}

.btn.primary:hover {
    background: #1d4ed8;
}

.btn.large {
    min-width: 180px;
    min-height: 48px;
    font-size: 16px;
}

.level-section {
    margin-top: 52px;
}

.section-title {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
}

.level-result-text {
    margin: 0 0 24px;
    color: #a9bfdc;
    font-size: 16px;
}

.level-table-wrap {
    width: 100%;
    margin-top: 18px;
    border: 1px solid #263750;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(10, 18, 34, 0.65);
}

.level-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 0;
}

.level-table th {
    padding: 18px 20px;
    background: rgba(35, 51, 78, 0.75);
    color: #93c5fd;
    font-size: 14px;
    text-align: left;
    border-bottom: 1px solid #263750;
}

.level-table td {
    padding: 22px 20px;
    border-bottom: 1px solid #263750;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.level-table th:first-child,
.level-table td:first-child {
    width: 90px;
    text-align: center;
}

.level-table input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #2563eb;
}

.work-account-section {
    margin-top: 64px;
}

.account-count-text {
    margin: 0 0 20px;
    color: #a9bfdc;
    font-size: 16px;
}

.account-select-box {
    width: 100%;
    border: 1px solid #263750;
    border-radius: 16px;
    background: rgba(10, 18, 34, 0.65);
    overflow: hidden;
}

.account-select-header {
    min-height: 60px;
    padding: 0 28px;
    border-bottom: 1px solid #263750;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-select-header label {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 900;
    color: #fff;
}

.selected-count {
    color: #d8e7ff;
    font-weight: 800;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 24px;
    margin-top: 0;
}

.account-card {
    min-height: 74px;
    padding: 0 24px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #020617;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

.account-card:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.account-card input[type="checkbox"],
.account-select-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2563eb;
}

.empty-box {
    grid-column: 1 / -1;
    padding: 30px;
    border: 1px dashed #334155;
    border-radius: 14px;
    color: #94a3b8;
    text-align: center;
}

.submit-wrap {
    margin-top: 36px;
    display: flex;
    justify-content: flex-end;
}

.work-grid {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 18px;
    align-items: end;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .level-table-wrap {
        overflow-x: auto;
    }

    .level-table {
        min-width: 760px;
    }

    .account-grid {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .account-select-header {
        height: auto;
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .submit-wrap {
        justify-content: stretch;
    }

    .submit-wrap .btn {
        width: 100%;
    }
}

/* =========================
   work_list.php 전용
========================= */

.work-list-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.work-list-card,
.work-detail-card {
    min-height: 600px;
}

.work-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.work-item {
    display: block;
    padding: 16px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #020617;
    color: #e5e7eb;
    text-decoration: none;
}

.work-item:hover,
.work-item.active {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}

.work-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.work-item-head strong {
    font-size: 16px;
    color: #fff;
}

.work-item-meta {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 13px;
}

.work-item-date {
    margin-top: 10px;
    color: #64748b;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-ready {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-running {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-stopped {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-done {
    background: rgba(168, 85, 247, 0.16);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.work-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.work-detail-head h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #fff;
}

.work-detail-head p {
    margin: 0;
    color: #94a3b8;
    word-break: break-all;
}

.target-box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 34px;
}

.target-box div {
    padding: 16px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #020617;
}

.target-box span {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.target-box strong {
    color: #fff;
    font-size: 20px;
}

.account-status-title {
    margin-top: 0;
    margin-bottom: 16px;
}

.account-status-table-wrap {
    overflow-x: auto;
    border: 1px solid #263244;
    border-radius: 14px;
}

.account-status-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    margin-top: 0;
}

.account-status-table th {
    padding: 15px 14px;
    background: rgba(35, 51, 78, 0.75);
    color: #93c5fd;
    font-size: 13px;
    text-align: left;
    border-bottom: 1px solid #263244;
}

.account-status-table td {
    padding: 16px 14px;
    border-bottom: 1px solid #263244;
    color: #e5e7eb;
    vertical-align: middle;
}

.account-status-table td strong {
    display: block;
    color: #fff;
    font-size: 15px;
}

.account-status-table td small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
}

.account-status-table .ok {
    color: #86efac;
    font-weight: 900;
}

.account-status-table .need {
    color: #fca5a5;
    font-weight: 900;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.result-badge.done {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.result-badge.ready {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.empty-table {
    text-align: center;
    color: #94a3b8 !important;
    padding: 36px !important;
}

@media (max-width: 1100px) {
    .work-list-layout {
        grid-template-columns: 1fr;
    }

    .target-box {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .target-box {
        grid-template-columns: 1fr;
    }

    .work-detail-head {
        flex-direction: column;
    }
}