* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Malgun Gothic", "맑은 고딕", sans-serif; color: #333; background: #e9edf2; font-size: 12px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f3f3f3; }
.login-wrap { display: grid; grid-template-columns: 220px 360px 220px; gap: 18px; align-items: center; }
.login-wrap.compact { grid-template-columns: 360px 220px; }
.login-panel { background: #fff; border: 1px solid #c9c9c9; padding: 32px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.login-title { text-align: center; margin-bottom: 24px; }
.login-title h1 { margin: 0; font-size: 24px; letter-spacing: 1px; color: #222; }
.login-title p { margin: 4px 0 0; color: #777; font-weight: bold; }
.login-panel label { display: block; margin: 12px 0 5px; font-weight: bold; }
.login-panel input[type="text"], .login-panel input[type="password"] { width: 100%; border: 1px solid #bbb; padding: 10px; }
.remember-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; color: #777; }
.remember-row label { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: #333; }
.login-panel button { width: 100%; padding: 11px; border: 0; background: rgb(254, 229, 0); color: rgb(43, 41, 39); font-size: 18px; font-weight: 700; cursor: pointer; }
.login-ad { min-height: 240px; padding: 22px; border: 1px solid #d3d3d3; background: linear-gradient(135deg, #304a6f, #77a0ce); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.login-ad.right { background: linear-gradient(135deg, #5b6b7a, #b3c2d2); }
.login-ad strong { font-size: 20px; margin-bottom: 8px; }
.login-footer { margin-top: 18px; color: #888; }
.login-error { padding: 8px; background: #fff2f2; border: 1px solid #e3b6b6; color: #b00000; margin-bottom: 12px; }
.seed-hint { text-align: center; color: #888; margin: 14px 0 0; }

.cg-admin-body { min-width: 1180px; }
.color-strip { display: grid; grid-template-columns: repeat(5, 1fr); height: 5px; }
.color-strip span:nth-child(1) { background: #e43d30; }
.color-strip span:nth-child(2) { background: #f3b420; }
.color-strip span:nth-child(3) { background: #48a64b; }
.color-strip span:nth-child(4) { background: #1e88d1; }
.color-strip span:nth-child(5) { background: #7654b4; }
.topbar { height: 46px; background: #fff; border-bottom: 1px solid #cfd6df; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.club-title { font-size: 17px; font-weight: bold; color: #2b3a4c; }
.top-date { color: #666; }
.quick-tabs { height: 36px; display: flex; align-items: end; gap: 3px; padding: 0 18px; background: #f5f6f8; border-bottom: 1px solid #cfd6df; }
.quick-tabs a { display: block; min-width: 92px; text-align: center; padding: 8px 12px; background: #fff; border: 1px solid #c7cdd5; border-bottom: 0; color: #444; }
.quick-tabs a.active { background: #2f5f92; color: #fff; border-color: #2f5f92; }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 87px); }
.sidebar { background: #f7f8fa; border-right: 1px solid #c8d0d9; padding: 12px; }
.profile-card { display: flex; gap: 10px; padding: 12px; background: #fff; border: 1px solid #ccd3da; margin-bottom: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #ced8e4; color: #2d4d6d; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: bold; }
.profile-card strong, .profile-card span, .profile-card a { display: block; }
.profile-card span { color: #777; margin: 3px 0; }
.profile-card a { color: #1d5da8; }
.quick-search { display: grid; grid-template-columns: 1fr 50px; gap: 4px; margin-bottom: 10px; }
.quick-search input { border: 1px solid #b8c1cc; padding: 7px; background: #fff; }
.quick-search button { border: 1px solid #365d82; background: #476f99; color: #fff; cursor: pointer; }
.nav-group { margin-bottom: 4px; border: 1px solid #c6ced8; background: #fff; }
.nav-title { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: linear-gradient(#fff, #edf1f5); font-weight: bold; color: #34495e; }
.nav-title.active { color: #0f5591; }
.nav-items { display: none; padding: 4px 0; border-top: 1px solid #dde3ea; background: #fbfcfd; }
.nav-group.open .nav-items { display: block; }
.nav-items a { display: block; padding: 5px 12px 5px 22px; color: #555; }
.nav-items a:before { content: "- "; color: #999; }
.nav-items a.active, .nav-items a:hover { color: #0b5d9e; background: #edf5fb; }
.content-area { padding: 14px; overflow-x: auto; }

.flash { margin-bottom: 10px; padding: 9px 12px; border: 1px solid #c8d0d9; background: #fff; }
.flash.success { border-color: #a6c8a9; color: #237333; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; padding: 12px 14px; background: #fff; border: 1px solid #c8d0d9; }
.page-head span { color: #78838f; }
.page-head h1 { margin: 4px 0; font-size: 20px; color: #26384c; }
.page-head p { margin: 0; color: #667; }
.green-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #398041; background: #49a24f; color: #fff; padding: 8px 18px; font-weight: bold; cursor: pointer; }
.plain-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #b7bec8; background: #fff; padding: 8px 18px; }

.card { background: #fff; border: 1px solid #c8d0d9; margin-bottom: 10px; }
.card-header { min-height: 36px; padding: 8px 10px; border-bottom: 1px solid #d7dde4; background: #f6f8fa; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h3 { margin: 0; font-size: 13px; color: #33485f; }
.card-header input { border: 1px solid #b8c1cc; padding: 6px; }
.card-header button { border: 1px solid #637c99; background: #748ca5; color: #fff; padding: 6px 10px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th { background: #eef2f6; border: 1px solid #d0d7df; padding: 7px 8px; color: #3f5062; white-space: nowrap; text-align: left; }
.data-table td { border: 1px solid #e1e5ea; padding: 7px 8px; vertical-align: middle; }
.data-table.compact th, .data-table.compact td { padding: 5px 7px; font-size: 11px; }
.data-table tr:hover td { background: #fbfdff; }
.table-scroll { overflow-x: auto; }
.table-toolbar { display: flex; justify-content: space-between; margin: 8px 0; color: #555; }
.empty-row { text-align: center; color: #888; padding: 26px !important; }
.mono { font-family: Consolas, monospace; }
.actions { white-space: nowrap; }
.actions a, .actions button { margin-right: 5px; color: #1a62a0; background: none; border: 0; cursor: pointer; padding: 0; }
.actions form { display: inline; }
.badge { display: inline-block; border: 1px solid; padding: 2px 6px; border-radius: 2px; font-size: 11px; }
.badge-green { background: #e8f6ea; border-color: #9ccca2; color: #247631; }
.badge-red { background: #fdecec; border-color: #d7a0a0; color: #aa2020; }
.badge-yellow { background: #fff7df; border-color: #dac070; color: #8a6612; }
.badge-blue { background: #eaf2fb; border-color: #9ebada; color: #1d5d95; }
.badge-gray { background: #eee; border-color: #ccc; color: #666; }

.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 10px; }
.welcome-panel, .notice-panel, .visitor-strip { background: #fff; border: 1px solid #c8d0d9; padding: 16px; }
.welcome-panel h1 { margin: 0 0 6px; font-size: 22px; color: #27394d; }
.welcome-panel p { margin: 0 0 14px; color: #666; }
.hero-actions { display: flex; gap: 8px; }
.hero-actions a { padding: 9px 16px; background: #3d78ad; color: #fff; border: 1px solid #2d5d88; font-weight: bold; }
.notice-panel h2, .visitor-strip h2 { margin: 0 0 10px; font-size: 14px; }
.notice-panel a { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #eef1f5; }
.notice-panel em { color: #888; font-style: normal; }
.media-row, .metric-row, .mini-card-row, .summary-tables { display: grid; gap: 10px; margin-top: 10px; }
.media-row { grid-template-columns: repeat(3, 1fr); }
.cover-block { min-height: 112px; padding: 18px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(0,0,0,.15); }
.cover-block strong { font-size: 19px; }
.cover-block.blue { background: linear-gradient(135deg, #2e5f93, #6998c4); }
.cover-block.green { background: linear-gradient(135deg, #2f7a4a, #80b879); }
.cover-block.orange { background: linear-gradient(135deg, #b77422, #d8b066); }
.cover-block.gray { background: linear-gradient(#f9fafb, #e6ebf1); color: #33485f; border-color: #c8d0d9; }
.metric-row { grid-template-columns: repeat(4, 1fr); }
.metric-card, .mini-card { background: #fff; border: 1px solid #c8d0d9; padding: 14px; }
.metric-card span, .mini-card span { color: #666; display: block; }
.metric-card strong { display: block; margin: 6px 0; font-size: 24px; color: #1d5da8; }
.metric-card em { color: #888; font-style: normal; }
.mini-card-row { grid-template-columns: repeat(4, 1fr); }
.mini-card strong { font-size: 15px; color: #33485f; }
.visitor-strip > div { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.visitor-item { min-width: 110px; border: 1px solid #d5dce4; padding: 8px; background: #fbfcfd; text-align: center; }
.visitor-item span { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: #dce7f3; align-items: center; justify-content: center; font-weight: bold; }
.visitor-item strong, .visitor-item em, .visitor-item small { display: block; margin-top: 3px; font-style: normal; }
.visitor-item em, .visitor-item small { color: #777; }
.summary-tables { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.dense-filter { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 6px; padding: 10px; background: #fff; border: 1px solid #c8d0d9; }
.dense-filter label, .form-grid label, .product-form-grid label, .stack-form label, .inline-form label { display: flex; flex-direction: column; gap: 4px; color: #505d6d; font-weight: bold; }
.dense-filter input, .dense-filter select, .form-grid input, .form-grid select, .form-grid textarea, .product-form-grid input, .product-form-grid select, .product-form-grid textarea, .stack-form input, .inline-form input { border: 1px solid #b8c1cc; padding: 7px; background: #fff; color: #333; font-weight: normal; }
.dense-filter .wide { grid-column: span 2; }
.filter-options { grid-column: 1 / -2; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: #555; }
.filter-options label { display: inline-flex; flex-direction: row; align-items: center; font-weight: normal; }
.filter-actions { display: flex; gap: 5px; justify-content: flex-end; }
.filter-actions button, .filter-actions a { padding: 7px 10px; border: 1px solid #667f99; background: #f8fafc; color: #334; }
.filter-actions button:first-child { background: #426b93; color: #fff; }
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.pagination a, .pagination span { padding: 6px 9px; border: 1px solid #c8d0d9; background: #fff; }
.pagination .active { background: #2f5f92; color: #fff; }

.register-form { display: grid; grid-template-columns: 170px 1fr; gap: 10px; background: #fff; border: 1px solid #c8d0d9; padding: 14px; }
.photo-box { border: 1px solid #c8d0d9; background: #f6f8fa; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #888; }
.photo-box div { width: 92px; height: 104px; border: 1px dashed #b8c1cc; display: flex; align-items: center; justify-content: center; background: #fff; }
.photo-box button { border: 1px solid #b8c1cc; background: #fff; padding: 5px 12px; }
.photo-box.small { min-height: 120px; width: 140px; float: left; margin-right: 14px; }
.form-grid.two-col { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px 12px; }
.form-grid textarea, .form-grid label:last-child { grid-column: 1 / -1; }
.submit-row { grid-column: 1 / -1; display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.member-detail { padding: 14px; overflow: hidden; }
.member-detail dl { display: grid; grid-template-columns: 100px 1fr 100px 1fr; gap: 8px 12px; margin: 0; }
.member-detail dt { font-weight: bold; color: #607080; }
.member-detail dd { margin: 0; }

.settings-layout { display: grid; grid-template-columns: 280px 1fr; gap: 10px; }
.settings-form { padding-bottom: 10px; }
.settings-form form, .stack-form { padding: 10px; }
.inline-form { display: grid; grid-template-columns: 1fr 54px; gap: 6px; align-items: end; }
.inline-form button, .stack-form button { border: 1px solid #398041; background: #49a24f; color: #fff; padding: 7px 12px; }
.category-tags { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 10px; }
.category-tags span { border: 1px solid #c8d0d9; background: #f7f9fb; padding: 4px 7px; }
.wide-card { grid-column: span 1; }
.settings-layout .wide-card:last-child { grid-column: 1 / -1; }
.product-form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 8px; padding: 10px; }
.product-form-grid .full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .login-wrap, .admin-shell, .dash-grid, .media-row, .metric-row, .mini-card-row, .summary-tables, .settings-layout, .register-form { grid-template-columns: 1fr; }
  .login-ad { display: none; }
  .cg-admin-body { min-width: 0; }
  .dense-filter, .product-form-grid, .form-grid.two-col { grid-template-columns: 1fr; }
  .filter-options, .dense-filter .wide { grid-column: auto; }
}
