:root {
    --bg: #05070a;
    --surface: #10131a;
    --surface-low: #191c22;
    --surface-card: rgba(255, 255, 255, 0.035);
    --line: rgba(255, 255, 255, 0.09);
    --text: #e1e2eb;
    --muted: #bac9cc;
    --primary: #00e5ff;
    --primary-soft: rgba(0, 229, 255, 0.14);
    --accent: #7000ff;
    --danger: #ff4d5f;
    --warning: #ffd232;
    --ok: #8cf59f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(16, 19, 26, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.08);
}
.topbar-inner {
    max-width: 1280px;
    height: 76px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 3.5rem; width: auto; object-fit: contain; }
.nav { display: flex; align-items: center; gap: 24px; margin-left: 16px; }
.nav a, .mobile-nav a {
    color: var(--muted);
    font-weight: 700;
    transition: color .2s ease, background .2s ease;
}
.nav a:hover, .mobile-nav a:hover { color: var(--primary); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, .25);
    background: var(--primary-soft);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 700;
}
.mobile-nav {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mobile-nav.open { display: grid; }
.mobile-nav a {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}
.menu-button { display: none !important; }

.page { max-width: 1280px; min-height: calc(100vh - 260px); margin: 0 auto; padding: 56px 24px 80px; }
.hero-search {
    margin: -56px calc(50% - 50vw) 48px;
    padding: 72px 24px 52px;
    background: radial-gradient(circle at 50% 20%, rgba(0, 229, 255, 0.18), transparent 48%), #061025;
    border-bottom: 1px solid rgba(0, 229, 255, .12);
    text-align: center;
}
.hero-search-inner {
    max-width: 1280px;
    margin: 0 auto;
}
.hero-search .search-row {
    max-width: 760px;
    margin: 0 auto;
}
.hero-search h1 { margin: 0 0 12px; font-size: clamp(34px, 5vw, 56px); line-height: 1.1; letter-spacing: 0; }
.hero-search p { margin: 0 0 24px; color: var(--muted); font-size: 17px; }

.tool-header {
    padding: 44px 0 0;
    margin-bottom: 24px;
}
.tool-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.tool-title .material-symbols-outlined { color: var(--primary); }
.tool-title h1 { margin: 0; font-size: 28px; line-height: 1.25; }
.tool-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .42);
}
.tool-search.compact {
    grid-template-columns: auto minmax(260px, 360px) auto;
    justify-content: start;
}
.tool-search.trade-filter {
    grid-template-columns: minmax(160px, 200px) 1fr auto auto;
}
.tool-search input[name="q"] {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .16);
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 50px;
}
.tool-search input[name="q"]::placeholder {
    color: rgba(186, 201, 204, .62);
    font-weight: 600;
}
.tool-search .button {
    min-height: 50px;
    padding-top: 0;
    padding-bottom: 0;
}
.search-note {
    color: var(--muted);
    text-align: center;
    margin: 28px 0 34px;
}

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 22px; }
.section-head h2, .panel-title { margin: 0; font-size: 28px; line-height: 1.25; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.stack { display: grid; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.glass, .card, .panel {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    backdrop-filter: blur(20px);
}
.panel { padding: 24px; }
.card { padding: 24px; }
.stat-card { min-height: 132px; display: grid; place-items: center; text-align: center; }
.stat-card .material-symbols-outlined { color: var(--primary); font-size: 34px; }
.stat-card strong { display: block; margin-top: 6px; font-size: 30px; }
.stat-card span { color: var(--muted); font-weight: 700; }

.search-row { display: flex; gap: 10px; align-items: center; justify-content: center; }
.search-row.wide { justify-content: stretch; margin-bottom: 24px; }
.row-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-actions form { margin: 0; }
.entry-card .row-actions { margin-top: auto; flex-wrap: wrap; white-space: normal; }
.notice-inline-actions {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
}
.notice-inline-actions a,
.notice-inline-actions button {
    color: var(--primary);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 800;
}
.notice-inline-actions form { margin: 0; }
.input, input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    width: 100%;
    color: var(--text);
    background: rgba(0, 0, 0, .16);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    padding: 12px 14px;
    outline: none;
}
select,
select option {
    background: #05070a;
    color: var(--text);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 229, 255, .12); }
label { display: block; margin-bottom: 8px; color: var(--text); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-full { grid-column: 1 / -1; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}
.button.primary { color: #001f24; background: var(--primary); box-shadow: 0 0 18px rgba(0, 229, 255, .22); }
.button.secondary { color: var(--text); background: rgba(112, 0, 255, .38); border-color: rgba(112, 0, 255, .55); }
.button.warning { color: #111; background: var(--warning); }
.button.danger { color: #fff; background: rgba(255, 77, 95, .82); }
.button.ghost { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.button.sm { padding: 8px 11px; font-size: 14px; }
.icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.entry-card { min-height: 300px; display: flex; flex-direction: column; gap: 14px; }
.blacklist-card { min-height: 342px; }
.secure-note {
    min-height: 84px;
    padding: 14px;
    margin: 0;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1.55;
}
.entry-badge {
    width: 100%;
    min-height: 104px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #191b1d;
    text-align: center;
}
.entry-badge .red { padding: 10px; background: #df2d31; font-size: 24px; font-weight: 900; }
.entry-badge .blue { padding: 10px; background: #1664d8; font-size: 24px; font-weight: 900; }
.entry-badge .body { padding: 16px 10px; font-size: 25px; font-weight: 900; overflow-wrap: anywhere; }
.entry-badge .amount { color: #ffe600; font-size: 20px; }
.kv { display: grid; grid-template-columns: 82px 1fr; gap: 6px; font-size: 14px; }
.kv dt { color: var(--muted); background: rgba(255, 255, 255, .05); padding: 6px; }
.kv dd { margin: 0; padding: 6px; font-weight: 800; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
    padding: 16px;
    overflow: auto;
}
.modal-panel {
    max-width: 980px;
    min-height: 70vh;
    margin: 0 auto;
    background: #121419;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: 24px;
}
.notice-detail-modal { max-width: 860px; }
.notice-detail-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    border-radius: 10px;
    object-fit: contain;
}
.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}
.check-row input { width: auto; }
.notice-popup-layer {
    position: fixed;
    inset: 0;
    z-index: 35;
    padding: 24px;
    background: rgba(0, 0, 0, .42);
    pointer-events: none;
    overflow: auto;
}
.notice-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 600px));
    gap: 18px;
    justify-content: start;
    align-items: start;
}
.notice-popup {
    width: min(600px, calc(100vw - 48px));
    background: #121419;
    border: 1px solid rgba(0, 229, 255, .28);
    border-radius: 12px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .42), 0 0 24px rgba(0, 229, 255, .12);
    overflow: hidden;
    pointer-events: auto;
}
.notice-popup header {
    padding: 14px 16px;
    color: var(--text);
    font-weight: 900;
    border-bottom: 1px solid var(--line);
}
.notice-popup-body {
    background: #05070a;
    aspect-ratio: 600 / 750;
}
.notice-popup-body img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.notice-popup-content {
    width: 100%;
    height: 100%;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
    line-height: 1.65;
    text-align: center;
    background: radial-gradient(circle at 50% 25%, rgba(0, 229, 255, .14), transparent 55%), #10131a;
}
.notice-popup footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: rgba(255, 255, 255, .035); }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 900; }
.status.active, .status.approved { color: var(--ok); background: rgba(140, 245, 159, .12); }
.status.pending { color: var(--warning); background: rgba(255, 210, 50, .12); }
.status.suspended, .status.rejected { color: var(--danger); background: rgba(255, 77, 95, .12); }

.alert { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); }
.alert.ok { color: var(--ok); background: rgba(140, 245, 159, .08); }
.alert.danger { color: var(--danger); background: rgba(255, 77, 95, .08); }
.auth-shell { max-width: 640px; margin: 40px auto; }
.footer {
    padding: 48px 24px 64px;
    text-align: center;
    background: rgba(255, 255, 255, .03);
    border-top: 1px solid var(--line);
}
.footer img { height: 42px; width: auto; margin-bottom: 18px; }
.footer p { margin: 8px 0; color: var(--text); }

@media (max-width: 1024px) {
    .nav { display: none; }
    .menu-button { display: inline-flex !important; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .topbar-inner { height: 64px; padding: 0 12px; gap: 8px; }
    .brand img { height: 2.25rem; }
    .top-actions { gap: 6px; }
    .user-chip { padding: 7px 9px; font-size: 12px; }
    .notice-inline-actions { display: flex; }
    .page { padding: 40px 12px 64px; }
    .hero-search { padding: 54px 12px 42px; }
    .tool-search, .tool-search.compact, .tool-search.trade-filter { grid-template-columns: 1fr; }
    .notice-popup-layer {
        padding: 12px;
        overflow: hidden;
    }
    .notice-popup-grid {
        display: block;
        position: relative;
        min-height: calc(100vh - 24px);
    }
    .notice-popup {
        position: absolute;
        top: calc(var(--popup-index) * 18px);
        left: calc(var(--popup-index) * 10px);
        width: min(92vw, 600px);
    }
    .notice-popup footer { flex-direction: column; }
    .search-row, .search-row.wide, .section-head { flex-direction: column; align-items: stretch; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .button { width: 100%; }
    .icon-button, .menu-button { width: 38px; flex: 0 0 38px; }
}
