@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #000000;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-nav: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-cyan: #22d3ee;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-pill: 100px;
    --sidebar-w: 300px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Poppins', 'Noto Sans Thai', sans-serif;
    line-height: 1.7;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient Background Glow */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* ===== FLOATING PILL NAVBAR ===== */
.global-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    max-width: 1200px;
    height: 64px;
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    padding: 0 12px 0 28px;
    z-index: 1000;
}

.header-logo {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.header-logo .logo-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 2px;
    box-shadow: 0 0 12px var(--accent);
}

.header-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.header-nav a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.header-nav a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.header-right {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 20px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 13px;
    color: #a5b4fc;
    white-space: nowrap;
}

.btn-nav {
    background: var(--accent);
    color: #fff;
    padding: 8px 22px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-nav:hover {
    background: #818cf8;
    transform: scale(1.03);
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 40px 60px;
    gap: 32px;
    position: relative;
    z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
}

.sidebar-card {
    position: sticky;
    top: 110px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(12px);
}

.sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    margin-bottom: 20px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow-y: auto;
}

.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
}

.service-item .svc-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    font-size: 18px;
    margin-right: 14px;
}

.service-item .svc-name {
    font-weight: 600;
    font-size: 14px;
}

.service-item .svc-price {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 32px;
    backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
}

.btn-pill {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.btn-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-accent {
    padding: 10px 28px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-accent:hover {
    background: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

/* ===== TABLES ===== */
.tbl-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th {
    text-align: left;
    padding: 0 20px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

td {
    padding: 18px 20px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

td:first-child {
    border-left: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

/* ===== OTP CODE ===== */
.otp-code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(34, 211, 238, 0.08);
    color: var(--accent-cyan);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 2px;
    border: 1px solid rgba(34, 211, 238, 0.15);
}

/* ===== STATUS TAGS ===== */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 12px;
}

.status-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-waiting { color: var(--warning); }
.status-waiting::before {
    background: var(--warning);
    animation: pulse-dot 2s infinite;
}

.status-done { color: var(--success); }
.status-done::before { background: var(--success); }

.status-cancelled { color: var(--error); }
.status-cancelled::before { background: var(--error); }

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.3); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow-pulse {
    from { box-shadow: 0 0 8px rgba(34, 211, 238, 0.2); }
    to { box-shadow: 0 0 24px rgba(34, 211, 238, 0.5); }
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 48px;
}

.auth-logo h1 {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 12px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    backdrop-filter: blur(12px);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* ===== FOOTER ===== */
.page-footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .global-header { width: calc(100% - 40px); top: 12px; }
    .app-container { flex-direction: column; padding: 100px 20px 40px; }
    .sidebar { width: 100%; }
    .sidebar-card { position: static; }
}

@media (max-width: 640px) {
    .global-header { padding: 0 16px; }
    .header-nav { display: none; }
    .content-card { padding: 24px; }
    .card-header h2 { font-size: 18px; }
}
