:root {
    --bg: #fdfbf7;
    --menu-bar: #F8FBFF;
    --card: #FCFEFF;
    --text: #2c2f33;
    --muted: #6b7280;
    --primary: #2fbf9a;
    --primary-weak: #e4f7f2;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Noto Sans KR", "Roboto", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary);
}

.app {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--menu-bar);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.sidebar-logo img {
    width: 160px;
    max-width: 100%;
    height: auto;
    display: block;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #000000;
    margin: 8px 0 24px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    white-space: nowrap;
    justify-content: center;
    width: var(--nav-slot, auto);
}

.nav a svg,
.nav .nav-disabled svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.nav-icon-img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    margin-top: 2px;
}

.nav-label {
    display: inline-block;
    font-size: 20px;
    font-weight: 700;
}

.nav .nav-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    color: #9ca3af;
    border-radius: 8px;
    cursor: not-allowed;
    white-space: nowrap;
    justify-content: center;
    width: var(--nav-slot, auto);
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-tabs {
    font-size: 16px;
}

.nav a.active,
.nav a:hover {
    background: var(--primary-weak);
    color: var(--primary);
}

.main {
    padding: 24px 28px 40px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.topbar-inline {
    margin-left: auto;
}

.topbar-icons {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-right: 12px;
}

.icon-button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-button svg {
    width: 18px;
    height: 18px;
    stroke: #374151;
}

.notification-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 220;
}

.notification-modal.active {
    display: flex;
}

.notification-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.notification-card {
    position: relative;
    width: min(860px, 94vw);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.notification-header {
    background: #2fbf9a;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding: 10px 16px;
}

.notification-body {
    padding: 12px 16px 0;
}

.notification-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.notification-filter select {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    width: 220px;
}

.notification-table {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.notification-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.notification-table th,
.notification-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.notification-table th {
    background: #2fbf9a;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.notification-table tbody tr:last-child td {
    border-bottom: none;
}

.notification-scroll {
    max-height: 360px;
    overflow: auto;
}

.notification-row-link {
    color: #2fbf9a;
    font-weight: 600;
}

.notification-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 14px;
}

.notification-footer .button {
    min-width: 0;
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.button.secondary {
    background: #f4f6f8;
    color: var(--text);
    border: 1px solid var(--border);
}

.button.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.button.repeat-lesson {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: #ffffff;
    display: inline-block;
    position: relative;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

input[type="radio"]:checked {
    background: var(--primary);
    box-shadow: inset 0 0 0 2px #ffffff;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    border: 1px solid var(--primary);
    border-radius: 3px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    vertical-align: middle;
}

input[type="checkbox"]:checked {
    background: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 6px;
    height: 3px;
    border: 2px solid #ffffff;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg);
    display: block;
}

.active-tab {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.button.secondary.active-tab {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.lesson-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-row label {
    font-size: 12px;
    color: var(--muted);
}

.locker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 12px;
    overflow: visible;
}

.locker-card {
    text-decoration: none;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 6px 10px;
    text-align: center;
    background: #ffffff;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: visible;
}

.locker-card .locker-status {
    font-size: 11px;
    color: #6b7280;
    background: #e5e7eb;
    border-radius: 6px;
    padding: 2px 6px;
    display: inline-block;
    margin: 0 auto 4px;
}

.locker-card .locker-number {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.locker-card .locker-name {
    font-size: 11px;
    color: #6b7280;
    min-height: 14px;
}

.locker-card.locker-in_use {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.locker-card.locker-in_use .locker-status {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.locker-card.locker-in_use .locker-number,
.locker-card.locker-in_use .locker-name {
    color: #fff;
}

.locker-card.locker-expired {
    border-color: #f59e0b;
}

.locker-card.locker-expired .locker-status {
    background: #fde68a;
    color: #92400e;
}

.locker-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    z-index: 50;
}

.locker-section {
    overflow: visible;
}

.locker-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(12px, -50%);
    width: 160px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
    text-align: left;
}

.locker-tooltip::after {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.06));
}

.locker-tooltip-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    margin: 0 auto 8px;
}

.locker-tooltip-row {
    font-size: 11px;
    color: #374151;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.locker-tooltip-row span {
    color: var(--muted);
}

.locker-card {
    position: relative;
}

.locker-card:hover .locker-tooltip {
    opacity: 1;
    visibility: visible;
}

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 191, 143, 0.2);
}

.tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--primary-weak);
    color: var(--primary);
    font-weight: 600;
}

.tag.expired {
    background: #e5e7eb;
    color: #6b7280;
}

.tag.pending {
    background: #fef3c7;
    color: #92400e;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat .label {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 960px) {
    .sidebar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .nav {
        width: 100%;
        flex-wrap: wrap;
    }
}
