* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: Tahoma, Arial, sans-serif;
    font-size: 13px;
    background-color: #f4f4f4;
    color: #333;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Top bar */
.topbar {
    width: 100%;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}
.topbar-left {
    display: flex;
    align-items: center;
}
.logo {
    font-size: 22px;
    font-weight: bold;
    color: #e53935;
    margin-right: 40px;
}
.top-menu {
    display: flex;
    gap: 20px;
    font-size: 13px;
}
.top-menu a {
    color: #555;
}
.top-menu a.active {
    font-weight: bold;
    color: #e53935;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.avatar-lg {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
}

/* Main container */
.main-wrapper {
    max-width: 1200px;
    margin: 20px auto 40px auto;
    display: flex;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 2px rgba(0,0,0,0.15);
    padding: 15px 0;
}
.sidebar-user {
    text-align: center;
    padding: 10px 15px 15px 15px;
    border-bottom: 1px solid #eee;
}
.sidebar-user-name {
    font-weight: bold;
    margin-top: 5px;
}
.sidebar-user-id {
    font-size: 11px;
    color: #777;
}
.sidebar-menu {
    margin-top: 5px;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    font-size: 13px;
    color: #444;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: #f5f5f5;
    border-left: 3px solid #e53935;
    padding-left: 15px;
    color: #e53935;
}
.sidebar-menu-icon {
    width: 18px;
    margin-right: 8px;
    text-align: center;
    color: #888;
}

/* Content panel */
.content-panel {
    flex: 1;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 2px rgba(0,0,0,0.15);
    padding: 20px 30px;
}
.content-title {
    font-size: 16px;
    border-bottom: 2px solid #e53935;
    padding-bottom: 8px;
    margin-bottom: 20px;
}
.form-row {
    display: flex;
    margin-bottom: 10px;
}
.form-label {
    width: 150px;
    padding-top: 6px;
    font-size: 12px;
    color: #666;
}
.form-field {
    flex: 1;
}
.form-field input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    background-color: #f9f9f9;
}
.form-field input[readonly] {
    background-color: #f3f3f3;
    color: #777;
}
.section-title {
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 13px;
}
.bonus-box {
    background: #fafafa;
    border: 1px solid #eee;
    padding: 10px 12px;
    border-radius: 3px;
    font-size: 12px;
}
.bonus-row {
    display: flex;
    margin-bottom: 5px;
}
.bonus-label {
    width: 180px;
    color: #666;
}
.bonus-value {
    flex: 1;
    font-weight: bold;
}
.bonus-actions {
    margin-top: 8px;
}
.btn {
    display: inline-block;
    padding: 6px 14px;
    background: #e53935;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    border: none;
    cursor: pointer;
}
.btn:hover {
    background: #c62828;
}

/* Footer */
.footer {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-bottom: 20px;
}

/* Point bar */
.point-bar {
    max-width: 1200px;
    margin: 10px auto 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    font-size: 12px;
    color: #333;
}
.point-item {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 2px rgba(0,0,0,0.1);
    padding: 6px 10px;
    min-width: 140px;
    text-align: right;
}
.point-label {
    color: #777;
    margin-bottom: 2px;
}
.point-value {
    font-weight: bold;
    color: #e53935;
}

/* Login Page */
.auth-bg {
    background: #f7f7f7;
    font-family: "Segoe UI", sans-serif;
}

.auth-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-box {
    width: 360px;
    background: #fff;
    padding: 28px 35px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.08);
}

.auth-box h2 {
    text-align: center;
    color: #e53935;
    font-size: 20px;
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    font-size: 13px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-primary {
    width: 100%;
    background: #e53935;
    color: #fff;
    border: none;
    padding: 9px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #c62828;
}

.auth-link {
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
}
td.pending {
    color: #cc8c00;
    font-weight: bold;
}

.menu-separator {
    height: 8px;
    border-bottom: 1px solid #e5e5e5;
    margin: 8px 0;
}
/* History card */
.history-card {
    margin-top: 12px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 12px 14px 14px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.history-title {
    font-weight: bold;
    font-size: 13px;
    color: #444;
}

.history-note {
    font-size: 11px;
    color: #999;
}

/* Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.data-table thead th {
    background: #f15b5b;
    color: #fff;
    padding: 8px 10px;
    text-align: center;
    font-weight: normal;
}

.data-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.data-table tbody tr:hover {
    background-color: #fff6f6;
}

/* มุมโค้งเล็กน้อย */
.data-table thead th:first-child {
    border-top-left-radius: 4px;
}
.data-table thead th:last-child {
    border-top-right-radius: 4px;
}
.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 4px;
}
.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 4px;
}

/* สถานะแบบ badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.badge-success {
    background: #e1f7e9;
    color: #1b8f3b;
}

.badge-pending {
    background: #fff4d9;
    color: #b8860b;
}

.badge-fail {
    background: #ffe1e1;
    color: #c62828;
}
/* Change Password Page */
.pw-card {
    background: #ffffff;
    padding: 14px 18px 18px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 380px;
}

.input-group {
    margin-bottom: 10px;
}

.input-group label {
    font-size: 12px;
    font-weight: bold;
    color: #444;
    margin-bottom: 4px;
    display: block;
}

.input-group input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
}

.note-text {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
}

.btn-submit {
    width: 100%;
    padding: 8px;
    border: none;
    background: #f15b5b;
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-submit:hover {
    background: #d14949;
}

/* Response message */
.response-msg {
    font-size: 12px;
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

.response-msg.success {
    color: #1b8f3b;
}

.response-msg.error {
    color: #c62828;
}

/* ===== IP Window Bonus (ซื้อจอเพิ่ม) ===== */

.ipwin-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 10px;
}

.ipwin-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    padding: 16px 18px 18px;
    flex: 1;
    min-width: 320px;
}

.ipwin-card-left {
    max-width: 420px;
}

.ipwin-card-right {
    flex: 1.3;
}

.ipwin-header {
    margin-bottom: 12px;
}

.ipwin-title-main {
    font-size: 15px;
    font-weight: bold;
    color: #e53935;
}

.ipwin-subtitle {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

/* สถิติปัจจุบัน */
.ipwin-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .ipwin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ipwin-stat {
    background: #fafafa;
    border-radius: 5px;
    padding: 8px 10px;
    border: 1px solid #f0f0f0;
}

.ipwin-stat-label {
    font-size: 11px;
    color: #777;
    margin-bottom: 3px;
}

.ipwin-stat-value {
    font-size: 13px;
    font-weight: bold;
    color: #444;
}

.ipwin-stat-value.highlight {
    color: #e53935;
}

/* ฟอร์มสั่งซื้อ */
.ipwin-form {
    margin-top: 6px;
}

.ipwin-form-row {
    display: flex;
    margin-bottom: 10px;
}

.ipwin-form-label {
    width: 130px;
    font-size: 12px;
    color: #666;
    padding-top: 6px;
}

.ipwin-form-field {
    flex: 1;
}

.ipwin-form-field input[type="number"] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    font-size: 12px;
    background: #fdfdfd;
}

.ipwin-form-field input[type="number"]:focus {
    outline: none;
    border-color: #f15b5b;
    box-shadow: 0 0 0 1px rgba(241,91,91,0.15);
}

.ipwin-input-hint {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* กล่องสรุปค่าบริการ */
.ipwin-preview-box {
    margin-top: 12px;
    border-radius: 6px;
    border: 1px solid #ffe4e4;
    background: linear-gradient(135deg, #fff8f8, #fff);
    padding: 10px 12px 12px;
    font-size: 12px;
}

.ipwin-preview-title {
    font-weight: bold;
    color: #e53935;
    margin-bottom: 8px;
}

.ipwin-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
}

.ipwin-preview-item {
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    padding: 6px 8px;
    border: 1px dashed #ffd6d6;
}

.ipwin-preview-item-total {
    grid-column: 1 / -1;
    background: #ffecec;
    border-style: solid;
}

.ipwin-preview-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}

.ipwin-preview-value {
    font-size: 13px;
    font-weight: bold;
    color: #444;
}

.ipwin-preview-value.main {
    font-size: 15px;
    color: #d62828;
}

.ipwin-preview-note {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* ปุ่ม + alert */
.ipwin-form-actions {
    margin-top: 12px;
    text-align: right;
}

.ipwin-btn-main {
    padding: 7px 18px;
    font-size: 13px;
    border-radius: 20px;
}

.ipwin-alert {
    font-size: 12px;
    padding: 7px 9px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ipwin-alert-error {
    background: #ffe1e1;
    color: #b71c1c;
    border: 1px solid #ffbaba;
}

.ipwin-alert-success {
    background: #e1f7e9;
    color: #1b8f3b;
    border: 1px solid #b3e6c2;
}


/* ==============================================================
   FLYFF ASTRA — Sovereign-inspired Member & Login Theme
   Dark burgundy / charcoal / antique gold
   Overrides only visual styles; keeps existing classes and logic.
   ============================================================== */
:root {
    --astra-bg: #100e12;
    --astra-panel: #1d171c;
    --astra-panel-2: #281c23;
    --astra-line: rgba(204,157,89,.26);
    --astra-gold: #d7b478;
    --astra-gold-bright: #f1d39c;
    --astra-text: #f3e8dd;
    --astra-muted: #b9a7a3;
    --astra-red: #8d2935;
}
body, body.auth-bg {
    color: var(--astra-text);
    background: radial-gradient(ellipse at 70% 0%, rgba(109,33,48,.28), transparent 46%),
                radial-gradient(ellipse at 0% 75%, rgba(87,36,50,.2), transparent 48%),
                #100e12;
    background-attachment: fixed;
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    min-height: 100vh;
}
a { color: var(--astra-gold); }
a:hover { color: var(--astra-gold-bright); }
.topbar {
    height: 72px;
    background: linear-gradient(90deg, #24151d, #171318 70%, #24151d);
    border-bottom: 1px solid var(--astra-line);
    box-shadow: 0 5px 25px rgba(0,0,0,.3);
}
.logo {
    color: var(--astra-gold-bright);
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 2px;
    text-shadow: 0 0 16px rgba(216,160,78,.28);
}
.top-menu a { color: var(--astra-muted); transition: color .2s; }
.top-menu a.active, .top-menu a:hover { color: var(--astra-gold-bright); }
.username { color: var(--astra-text); }
.avatar-circle {
    background: linear-gradient(145deg, #8b2938, #441923);
    border: 1px solid rgba(231,180,112,.55);
    color: var(--astra-gold-bright);
}
.main-wrapper { max-width: 1200px; align-items: stretch; }
.sidebar, .content-panel, .point-item, .auth-box {
    background: linear-gradient(150deg, rgba(43,29,37,.98), rgba(22,19,24,.98));
    border: 1px solid var(--astra-line);
    border-radius: 9px;
    box-shadow: 0 14px 35px rgba(0,0,0,.26), inset 0 1px rgba(255,226,173,.035);
}
.sidebar { overflow: hidden; }
.sidebar-user { border-bottom: 1px solid var(--astra-line); padding: 20px 14px; }
.sidebar-user-name { color: var(--astra-gold); }
.sidebar-user-id { color: var(--astra-muted); }
.sidebar-menu li a {
    color: #d9c9c1;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background .18s, color .18s;
    padding: 12px 18px;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background: linear-gradient(90deg, rgba(139,40,54,.35), rgba(139,40,54,.07));
    border-left: 3px solid var(--astra-gold);
    color: var(--astra-gold-bright);
    padding-left: 18px;
}
.sidebar-menu-icon { color: var(--astra-gold); }
.menu-separator { border-bottom: 1px solid var(--astra-line); }
.content-panel { min-width: 0; padding: 25px 30px; }
.content-title {
    color: var(--astra-gold-bright);
    border-bottom: 1px solid var(--astra-line);
    font-family: Georgia, Tahoma, serif;
    padding-bottom: 12px;
}
.point-bar { color: var(--astra-text); flex-wrap: wrap; }
.point-item { min-width: 140px; padding: 11px 15px; }
.point-label, .history-note, .note-text, .ipwin-subtitle, .ipwin-input-hint,
.ipwin-preview-note { color: var(--astra-muted); }
.point-value, .ipwin-title-main, .ipwin-stat-value.highlight,
.ipwin-preview-title, .ipwin-preview-value.main { color: var(--astra-gold-bright); }
.footer { color: var(--astra-muted); }
.form-label, .bonus-label, .ipwin-form-label, .ipwin-stat-label,
.ipwin-preview-label { color: var(--astra-muted); }
.section-title, .history-title, .input-group label, .form-group label,
.ipwin-stat-value, .ipwin-preview-value { color: var(--astra-text); }
.bonus-box, .history-card, .pw-card, .ipwin-card, .ipwin-stat,
.ipwin-preview-box, .ipwin-preview-item, .ipwin-preview-item-total {
    background: linear-gradient(140deg, #2c2028, #1b171d);
    color: var(--astra-text);
    border: 1px solid var(--astra-line);
    border-radius: 7px;
    box-shadow: none;
}
.ipwin-preview-item { border-style: dashed; }
.form-field input, .input-group input, .form-group input,
.ipwin-form-field input[type="number"] {
    background: #151217;
    border: 1px solid rgba(215,180,120,.32);
    color: var(--astra-text);
    border-radius: 5px;
    outline: none;
}
.form-field input:focus, .input-group input:focus, .form-group input:focus,
.ipwin-form-field input[type="number"]:focus {
    border-color: var(--astra-gold);
    box-shadow: 0 0 0 2px rgba(215,180,120,.12);
}
.form-field input[readonly] { background: #211c22; color: var(--astra-muted); }
.btn, .btn-primary, .btn-submit {
    background: linear-gradient(135deg, #9c3947, #6d2230);
    color: #fff1de;
    border: 1px solid rgba(222,177,112,.5);
    border-radius: 5px;
    transition: filter .2s, transform .2s;
}
.btn:hover, .btn-primary:hover, .btn-submit:hover {
    background: linear-gradient(135deg, #b24756, #852b39);
    filter: brightness(1.08);
}
.data-table { color: var(--astra-text); }
.data-table thead th {
    background: linear-gradient(180deg, #78303d, #4d222d);
    color: var(--astra-gold-bright);
    border-bottom: 1px solid var(--astra-line);
}
.data-table tbody td { border-bottom: 1px solid rgba(215,180,120,.14); }
.data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.data-table tbody tr:hover { background: rgba(157,61,73,.15); }
.badge-success { background: #183b30; color: #91dfb1; }
.badge-pending { background: #43321c; color: #f4c879; }
.badge-fail { background: #49232c; color: #ff9b9b; }
td.pending { color: #f4c879; }
.response-msg.success { color: #91dfb1; }
.response-msg.error { color: #ff9b9b; }
.ipwin-alert-error { background: #46212b; color: #ffb1b1; border-color: #7c3542; }
.ipwin-alert-success { background: #19382f; color: #9ae0b7; border-color: #3b775d; }
.auth-wrapper { min-height: 100vh; height: auto; padding: 30px 15px; }
.auth-box { width: 390px; max-width: 100%; padding: 36px; }
.auth-box h2 {
    color: var(--astra-gold-bright);
    font-family: Georgia, Tahoma, serif;
    font-size: 24px;
}
.auth-link a { color: var(--astra-gold); }
@media (max-width: 800px) {
    .topbar { padding: 0 16px; }
    .logo { margin-right: 15px; font-size: 18px; }
    .main-wrapper { margin: 14px 12px 30px; gap: 12px; flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar-menu { display: flex; flex-wrap: wrap; }
    .sidebar-menu li { flex: 1 1 auto; }
    .sidebar-menu li.menu-separator { flex-basis: 100%; }
    .content-panel { padding: 18px 14px; }
    .point-bar { margin: 12px; justify-content: center; }
    .point-item { flex: 1 1 130px; }
    .ipwin-card { min-width: 0; }
}
@media (max-width: 480px) {
    .top-menu { gap: 9px; font-size: 11px; }
    .topbar-right { gap: 5px; }
    .avatar-circle { display: none; }
    .main-wrapper { margin: 10px 8px 25px; }
    .form-row, .ipwin-form-row { flex-direction: column; gap: 6px; }
    .form-label, .ipwin-form-label { width: 100%; }
    .ipwin-preview-grid { grid-template-columns: 1fr; }
}
