
:root {
    --bg: #f6f9ff;
    --bg-2: #eef4ff;
    --surface: #ffffff;
    --surface-soft: #f7faff;
    --surface-blue: #f0f5ff;
    --surface-mint: #edfafa;
    --surface-yellow: #fff9e7;
    --surface-peach: #fff3ee;

    --line: #e3eaf4;
    --line-strong: #d5dfed;

    --text: #20324d;
    --text-2: #425773;
    --muted: #73849c;
    --muted-2: #96a4b7;

    --primary: #5678f6;
    --primary-dark: #3f61df;
    --primary-soft: #eaf0ff;

    --purple: #7567ef;
    --mint: #39b99f;
    --mint-dark: #268f7b;
    --yellow: #f1c44f;
    --peach: #ef8e69;
    --red: #df6470;

    --success-bg: #e8faf4;
    --success-text: #2b937b;

    --warning-bg: #fff8dc;
    --warning-text: #9b7812;

    --danger-bg: #fff0f2;
    --danger-text: #c4515e;

    --shadow-xs: 0 2px 8px rgba(46, 72, 112, 0.05);
    --shadow-sm: 0 8px 22px rgba(46, 72, 112, 0.07);
    --shadow-md: 0 14px 34px rgba(46, 72, 112, 0.10);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    --sidebar-width: 252px;
    --content-max: 1480px;
}

/* =========================================================
   Reset / Base
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(122, 144, 255, 0.08), transparent 26%),
        radial-gradient(circle at bottom left, rgba(82, 198, 178, 0.05), transparent 24%),
        var(--bg);
    color: var(--text);
    font-family:
        Pretendard,
        "Noto Sans KR",
        "Apple SD Gothic Neo",
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-size: 14px;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.025em;
}

h1 {
    font-size: 30px;
    line-height: 1.18;
}

h2 {
    font-size: 24px;
    line-height: 1.25;
}

h3 {
    font-size: 18px;
    line-height: 1.3;
}

h4 {
    font-size: 16px;
    line-height: 1.35;
}

p {
    color: var(--text-2);
}

::selection {
    background: rgba(86, 120, 246, 0.18);
}

/* =========================================================
   Layout
   ========================================================= */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    padding: 22px 15px 18px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,248,255,0.98));
    border-right: 1px solid var(--line);
    z-index: 20;
}

.main {
    min-width: 0;
    width: 100%;
}

/* =========================================================
   Brand / Sidebar
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 10px 20px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.03em;
    box-shadow: 0 9px 22px rgba(86, 120, 246, 0.24);
}

.brand strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    line-height: 1.3;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.nav {
    display: grid;
    gap: 5px;
    margin-top: 4px;
}

.nav-item {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #607189;
    font-weight: 750;
    text-align: left;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease,
        border-color 0.16s ease;
}

.nav-item:hover {
    background: #f0f4ff;
    color: var(--primary);
    border-color: #e7edff;
}

.nav-item:active {
    transform: translateY(1px);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #dce5ff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px 3px;
}

.sidebar-footer small {
    display: block;
    margin-top: 8px;
    color: var(--muted-2);
    font-size: 10px;
}

/* =========================================================
   Topbar
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 30px 18px;
    background: rgba(246, 249, 255, 0.94);
    backdrop-filter: blur(13px);
    border-bottom: 1px solid rgba(227, 234, 244, 0.88);
}

.topbar-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-title > div:last-child {
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 27px;
    color: var(--text);
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* =========================================================
   Views / Content
   ========================================================= */

.view {
    display: none;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 16px 30px 42px;
}

.active-view {
    display: block;
}

/* =========================================================
   Buttons
   ========================================================= */

.primary-button,
.secondary-button,
.icon-button,
.link-button {
    transition:
        background 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.primary-button,
.secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.primary-button {
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    box-shadow: 0 9px 20px rgba(86, 120, 246, 0.20);
}

.primary-button:hover {
    filter: brightness(1.02);
    box-shadow: 0 11px 24px rgba(86, 120, 246, 0.24);
}

.secondary-button {
    border: 1px solid var(--line-strong);
    background: rgba(255,255,255,0.95);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}

.secondary-button:hover {
    border-color: #bfd0ef;
    color: var(--primary);
    background: #fff;
}

.primary-button:active,
.secondary-button:active {
    transform: translateY(1px);
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--text-2);
}

.icon-button:hover {
    color: var(--primary);
    border-color: #c9d6ef;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.link-button:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================================================
   Common Cards
   ========================================================= */

.card {
    min-width: 0;
    background: rgba(255,255,255,0.97);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card > h3:first-child,
.card > h4:first-child {
    margin-top: 0;
}

.card p:last-child {
    margin-bottom: 0;
}

.card-pad {
    padding: 20px;
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 14px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
    display: grid;
    gap: 12px;
}

.card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.card-title > div {
    min-width: 0;
}

.card-title h3,
.card-title h4 {
    margin: 0;
}

.card-title p {
    margin: 5px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* =========================================================
   Eyebrow / Badges / Status
   ========================================================= */

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    gap: 5px;
    margin: 0 5px 5px 0;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #5e7088;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-soft);
    border-color: #d7e0ff;
    color: var(--primary);
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.status-done {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-run {
    background: var(--primary-soft);
    color: var(--primary);
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.system-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 11px;
    font-weight: 800;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(57, 185, 159, 0.08);
}

/* =========================================================
   Lesson Banner
   ========================================================= */

.lesson-banner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid #e4eaf4;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 91% 16%, rgba(115, 103, 239, 0.11), transparent 28%),
        linear-gradient(135deg, #fff9e9 0%, #edf4ff 100%);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.lesson-banner::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -80px;
    bottom: -100px;
    border-radius: 50%;
    background: rgba(57, 185, 159, 0.06);
}

.lesson-banner > div,
.lesson-banner > a,
.lesson-banner > button,
.lesson-banner > span {
    position: relative;
    z-index: 1;
}

.lesson-banner h2 {
    margin: 6px 0 7px;
    font-size: 24px;
    color: var(--text);
}

.lesson-banner p {
    max-width: 900px;
    margin: 0 0 12px;
    color: var(--text-2);
    font-size: 13px;
}

/* =========================================================
   Statistics
   ========================================================= */

.stat-card {
    position: relative;
    min-height: 126px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 95px;
    height: 95px;
    top: -40px;
    right: -35px;
    border-radius: 50%;
    background: rgba(86, 120, 246, 0.06);
}

.stat-card strong {
    position: relative;
    z-index: 1;
    color: var(--text-2);
    font-size: 12px;
}

.stat-value {
    position: relative;
    z-index: 1;
    margin: 10px 0 6px;
    color: var(--text);
    font-size: 29px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.stat-card small {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 11px;
}

.stat-accent {
    display: inline-flex;
    position: relative;
    z-index: 1;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 900;
}

.accent-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.accent-mint {
    background: var(--success-bg);
    color: var(--success-text);
}

.accent-yellow {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.accent-peach {
    background: var(--surface-peach);
    color: var(--peach);
}

/* =========================================================
   Report
   ========================================================= */

.report-card {
    overflow: hidden;
}

.report-head {
    padding: 19px 20px 17px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, #f8faff, #fff);
}

.report-head h3 {
    margin: 7px 0 0;
    font-size: 20px;
}

.report-content {
    padding: 20px;
    color: var(--text-2);
    line-height: 1.78;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.report-content a {
    color: var(--primary);
    text-decoration: underline;
}

/* =========================================================
   Ranking / Recommendation
   ========================================================= */

.rank-list {
    display: grid;
    gap: 9px;
}

.rank-item {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.rank-item:hover {
    background: #fbfcff;
    border-color: #d7e0f1;
}

.rank-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.rank-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.rank {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

/* =========================================================
   Tables
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    background: #f9fbff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

tbody td {
    padding: 12px 13px;
    border-bottom: 1px solid #edf1f6;
    color: var(--text-2);
    font-size: 12px;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fcfdff;
}

tbody strong {
    color: var(--text);
}

/* =========================================================
   Empty / Error
   ========================================================= */

.empty {
    padding: 32px 20px;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

.alert {
    padding: 14px 15px;
    border: 1px solid #ffd8d3;
    border-radius: 14px;
    background: #fff5f3;
    color: #aa5548;
    line-height: 1.6;
    box-shadow: var(--shadow-xs);
}

/* =========================================================
   Form Controls
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: 0;
    background: #fff;
    color: var(--text);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #a5b0bf;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #b7c7f5;
    box-shadow: 0 0 0 4px rgba(86, 120, 246, 0.08);
}

/* =========================================================
   Dialog
   ========================================================= */

.dialog {
    width: min(680px, calc(100vw - 28px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(29, 47, 76, 0.25);
}

.dialog::backdrop {
    background: rgba(31, 47, 73, 0.34);
    backdrop-filter: blur(4px);
}

.dialog form {
    display: grid;
    gap: 15px;
    padding: 20px;
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.dialog-header h2 {
    margin: 5px 0 0;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

/* =========================================================
   Utility
   ========================================================= */

.mobile-only {
    display: none;
}

.text-muted {
    color: var(--muted);
}

.text-small {
    font-size: 12px;
}

.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        padding-left: 22px;
        padding-right: 22px;
    }

    .view {
        padding-left: 22px;
        padding-right: 22px;
    }
}

@media (max-width: 940px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 20px 0 40px rgba(31, 49, 81, 0.12);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-only {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 17px 16px 14px;
    }

    .view {
        padding: 12px 16px 32px;
    }

    .topbar h1 {
        font-size: 23px;
    }

    .lesson-banner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .top-actions .secondary-button {
        display: none;
    }

    .topbar p {
        max-width: 70vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lesson-banner {
        padding: 20px;
    }

    .lesson-banner h2 {
        font-size: 21px;
    }

    .card {
        border-radius: 16px;
    }

    .rank-item {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .rank-item > .badge {
        grid-column: 2;
        justify-self: start;
    }

    .table-wrap {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .topbar {
        gap: 10px;
    }

    .topbar-title {
        gap: 8px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar p {
        font-size: 12px;
    }

    .view {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-pad {
        padding: 16px;
    }

    .lesson-banner {
        border-radius: 16px;
        padding: 17px;
    }

    .stat-card {
        min-height: 110px;
    }

    .stat-value {
        font-size: 25px;
    }

    .primary-button,
    .secondary-button {
        min-height: 40px;
        padding: 8px 11px;
    }

    table {
        min-width: 760px;
    }
}

/* =========================================================
   Print
   ========================================================= */

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .top-actions,
    .mobile-only,
    .nav {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .topbar {
        position: static;
        padding: 0 0 16px;
        border-bottom: 1px solid #ddd;
        background: #fff;
    }

    .view,
    .active-view {
        display: block !important;
        max-width: none;
        padding: 16px 0;
    }

    .card {
        box-shadow: none;
        break-inside: avoid;
    }
}


@media (max-width: 760px) {

    .history-table,
    .history-table thead,
    .history-table tbody,
    .history-table tr,
    .history-table td {
        display: block;
        width: 100%;
    }


    .history-table thead {
        display: none;
    }


    .history-table tbody {
        display: grid;
        gap: 10px;
    }


    .history-table tr {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--shadow-xs);
    }


    .history-table td {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 10px;

        padding: 8px 4px;

        border: 0;

        white-space: normal;

        overflow-wrap: anywhere;
    }


    .history-table td::before {

        content: attr(data-label);

        color: var(--muted);

        font-size: 11px;

        font-weight: 800;
    }


    .history-table td:last-child {

        padding-top: 12px;

        margin-top: 4px;

        border-top: 1px solid var(--line);

    }


    .history-table td:last-child::before {

        align-self: center;

    }

}




/* =========================================================
   Lesson Target Modal
   ========================================================= */

   .target-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}


.target-dialog form {
    display: grid;
    gap: 14px;
    padding: 22px;
}


.target-dialog .dialog-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}


/*
 * 학년도 / 학년 / 학기 / 학급 /
 * 수업일 / 차시
 */
.target-meta-row {

    display: flex;

    align-items: flex-end;

    gap: 10px;

    flex-wrap: nowrap;

}


.target-meta-row label {

    min-width: 0;

}


.target-small-field {
    width: 78px;
    flex: 0 0 78px;
}


.target-medium-field {
    width: 92px;
    flex: 0 0 92px;
}


.target-date-field {
    width: 145px;
    flex: 1 1 145px;
}


.target-meta-row input,
.target-meta-row select {
    min-height: 40px;
    padding: 8px 9px;
}


/*
 * 작은 화면에서는 자연스럽게 두 줄 이상으로 내려감
 */
@media (max-width: 700px) {

    .target-meta-row {

        flex-wrap: wrap;

    }


    .target-small-field,
    .target-medium-field,
    .target-date-field {

        flex: 1 1 90px;

        width: auto;

    }

}


/* =========================================================
   Responsive Tables
   ========================================================= */

@media (max-width: 760px) {

    .responsive-table {

        min-width: 0 !important;

        width: 100%;

        display: block;

    }


    .responsive-table thead {

        display: none;

    }


    .responsive-table tbody {

        display: grid;

        gap: 10px;

    }


    .responsive-table tr {

        display: grid;

        gap: 0;

        padding: 10px 12px;

        border:
            1px solid
            var(--line);

        border-radius:
            14px;

        background:
            #fff;

        box-shadow:
            var(--shadow-xs);

    }


    .responsive-table td {

        display: grid;

        grid-template-columns:
            70px
            minmax(0, 1fr);

        gap: 10px;

        padding:
            7px 2px;

        border: 0;

        white-space: normal;

        overflow-wrap: anywhere;

        font-size: 12px;

    }


    .responsive-table td::before {

        content:
            attr(data-label);

        color:
            var(--muted);

        font-size:
            11px;

        font-weight:
            800;

    }


    .responsive-table td:last-child {

        margin-top: 5px;

        padding-top: 10px;

        border-top:
            1px solid
            var(--line);

    }


    .table-empty {

        display:
            block !important;

        padding:
            30px !important;

        text-align:
            center !important;

    }

}


/* =========================================================
   Lesson Target Management Menu
   수집 계획 > 관리(⋯) 메뉴
   ========================================================= */

   .row-actions {
    position: relative;
    display: inline-block;
}


/* ---------------------------------------------------------
   ⋯ 버튼
   --------------------------------------------------------- */

.row-actions-button {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: #fff;
    color: var(--text-2);

    cursor: pointer;

    font-size: 18px;
    font-weight: 900;
    line-height: 1;

    transition:
        background 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}


.row-actions-button:hover {
    background: var(--surface-blue);
    color: var(--primary);
    border-color: #c8d5ef;
    box-shadow: var(--shadow-xs);
}


.row-actions-button:focus-visible {
    outline: none;

    border-color: var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(86, 120, 246, 0.10);
}


/* ---------------------------------------------------------
   details 기본 화살표 제거
   --------------------------------------------------------- */

.row-actions summary {
    list-style: none;
    cursor: pointer;
}


.row-actions summary::-webkit-details-marker {
    display: none;
}


/* ---------------------------------------------------------
   메뉴 박스
   --------------------------------------------------------- */

.row-actions-menu {
    position: absolute;

    top: calc(100% + 6px);
    right: 0;

    z-index: 100;

    width: 128px;

    padding: 5px;

    border:
        1px solid
        var(--line);

    border-radius: 12px;

    background: #fff;

    box-shadow:
        0 14px 32px
        rgba(31, 49, 81, 0.14);
}


/* ---------------------------------------------------------
   메뉴 항목
   --------------------------------------------------------- */

.row-actions-menu button {
    width: 100%;

    display: flex;
    align-items: center;

    min-height: 38px;

    padding: 8px 10px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: var(--text-2);

    font-size: 12px;
    font-weight: 750;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.row-actions-menu button:hover {
    background: var(--surface-soft);
    color: var(--primary);
}


/* ---------------------------------------------------------
   수정
   --------------------------------------------------------- */

.row-actions-menu
.row-action-edit:hover {
    background: var(--primary-soft);
    color: var(--primary);
}


/* ---------------------------------------------------------
   삭제
   --------------------------------------------------------- */

.row-actions-menu
.row-action-delete {
    color: var(--danger-text);
}


.row-actions-menu
.row-action-delete:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}


/* ---------------------------------------------------------
   완료된 항목의 삭제 버튼을 별도로 강조하지 않고
   Backend에서 실제 삭제 여부를 최종 판단
   --------------------------------------------------------- */


/* ---------------------------------------------------------
   모바일
   --------------------------------------------------------- */

@media (max-width: 760px) {

    .row-actions-button {
        width: 34px;
        height: 34px;
    }


    .row-actions-menu {
        right: 0;
        width: 120px;
    }


    .row-actions-menu button {
        min-height: 40px;
        padding: 9px 10px;
    }

}


/* ---------------------------------------------------------
   테이블 마지막 열 정렬
   --------------------------------------------------------- */

.lesson-target-table
td[data-label="관리"] {

    width: 72px;

    text-align: center;

    vertical-align: middle;
}


.lesson-target-table
th:last-child {

    width: 72px;

    text-align: center;

}


/* ---------------------------------------------------------
   모바일 카드형 테이블에서는 관리 메뉴를 오른쪽에 배치
   --------------------------------------------------------- */

@media (max-width: 760px) {

    .lesson-target-table
    td[data-label="관리"] {

        display: flex;

        align-items: center;
        justify-content: space-between;

        width: 100%;

        margin-top: 4px;

        padding-top: 10px;

        border-top:
            1px solid
            var(--line);

    }


    .lesson-target-table
    td[data-label="관리"]::before {

        content: attr(data-label);

        display: block;

        color: var(--muted);

        font-size: 11px;

        font-weight: 800;

    }

}