*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; background: #f5f5f0; color: #1f2124; min-height: 100vh; }

.admin-header { background: #ffffff; color: #1f2124; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #e8e5de; }
.admin-logo { height: 32px; }
.admin-back { color: #6b7280; text-decoration: none; font-size: 14px; font-weight: 600; }
.admin-back:hover { color: #1f2124; }

.admin-tabs { display: flex; background: white; border-bottom: 1px solid #e0ddd6; padding: 0 20px; position: sticky; top: 56px; z-index: 90; }
.admin-tab { padding: 14px 18px; background: none; border: none; border-bottom: 3px solid transparent; font-family: inherit; font-size: 14px; font-weight: 600; color: #6b7280; cursor: pointer; min-height: 48px; }
.admin-tab--active { color: #1f2124; border-bottom-color: #e58d34; }

.admin-main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-panel[hidden] { display: none; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-toolbar h2 { font-size: 20px; font-weight: 700; }

.btn-ghost { background: white; border: 1px solid #e0ddd6; color: #1f2124; padding: 8px 14px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 40px; }
.btn-ghost:hover { border-color: #e58d34; color: #e58d34; }
.btn-primary { background: #e58d34; color: white; border: none; padding: 14px 20px; border-radius: 12px; font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; letter-spacing: 0.5px; width: 100%; min-height: 48px; }
.btn-primary:hover { background: #d17a28; }
.btn-save { background: #059669; color: white; border: none; padding: 8px 14px; border-radius: 8px; font-family: inherit; font-weight: 600; font-size: 12px; cursor: pointer; min-height: 36px; }
.btn-save:hover { background: #047a56; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-table-wrap { background: white; border: 1px solid #e8e5de; border-radius: 14px; overflow: auto; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.admin-table th { text-align: left; padding: 12px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #6b7280; border-bottom: 1px solid #e8e5de; background: #faf9f5; position: sticky; top: 0; }
.admin-table td { padding: 10px; border-bottom: 1px solid #f0ede6; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-dirty { background: #fef9ee; }
.admin-table input[type="text"], .admin-table input[type="number"] { width: 100%; padding: 6px 8px; border: 1px solid #e0ddd6; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 12px; background: white; outline: none; }
.admin-table input[type="text"]:focus, .admin-table input[type="number"]:focus { border-color: #e58d34; }
.admin-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #e58d34; }
.admin-table .cell-code { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.admin-table .cell-header, .admin-table .cell-promo { min-width: 180px; }
.admin-table .cell-num { width: 90px; }
.admin-table .cell-term { font-family: 'JetBrains Mono', monospace; }
.admin-loading { text-align: center; color: #9ca3af; padding: 40px; }

.pin-modal { position: fixed; inset: 0; background: rgba(31,33,36,0.85); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.pin-modal[hidden] { display: none; }
.pin-panel { background: white; border-radius: 16px; padding: 28px 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.pin-panel h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.pin-panel p { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
#pin-input { width: 100%; padding: 14px; font-size: 24px; font-family: 'JetBrains Mono', monospace; text-align: center; letter-spacing: 12px; border: 2px solid #e0ddd6; border-radius: 12px; margin-bottom: 16px; outline: none; }
#pin-input:focus { border-color: #e58d34; }
.pin-error { color: #dc2626 !important; font-weight: 600; margin-top: 14px !important; margin-bottom: 0 !important; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #1f2124; color: white; padding: 14px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 1000; }
.toast[hidden] { display: none; }
