/* Apple-style clean design system */
:root {
    --apple-bg: #f5f5f7;
    --apple-card: #ffffff;
    --apple-text: #1d1d1f;
    --apple-secondary: #6e6e73;
    --apple-tertiary: #86868b;
    --apple-accent: #0071e3;
    --apple-accent-hover: #0077ed;
    --apple-border: #d2d2d7;
    --apple-radius-sm: 8px;
    --apple-radius: 12px;
    --apple-radius-lg: 20px;
    --apple-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --apple-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);
    --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--apple-font); color: var(--apple-text); background: #ffffff; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.apple-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #ffffff; }
.apple-card { background: var(--apple-card); border-radius: var(--apple-radius-lg); box-shadow: var(--apple-shadow-lg); padding: 20px 16px; width: 100%; max-width: 420px; }
.apple-brand { text-align: center; margin-bottom: 32px; }
.apple-brand img { height: 48px; width: auto; object-fit: contain; margin-bottom: 12px; }
.apple-brand h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.apple-brand p { color: var(--apple-secondary); font-size: 14px; margin: 0; }
.apple-field { margin-bottom: 18px; }
.apple-field label { display: block; font-size: 13px; font-weight: 500; color: var(--apple-secondary); margin-bottom: 6px; }
.apple-input { width: 100%; padding: 12px 14px; border: 1px solid var(--apple-border); border-radius: var(--apple-radius-sm); font-size: 16px; font-family: inherit; background: #fff; color: var(--apple-text); transition: border-color .15s ease, box-shadow .15s ease; }
.apple-input:focus { outline: none; border-color: var(--apple-accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15); }
.apple-input-group { display: flex; align-items: center; border: 1px solid var(--apple-border); border-radius: var(--apple-radius-sm); background: #fff; overflow: hidden; }
.apple-input-group span { padding: 0 12px; color: var(--apple-secondary); font-size: 15px; border-right: 1px solid var(--apple-border); background: #fafafa; height: 44px; display: flex; align-items: center; }
.apple-input-group input { border: none; flex: 1; padding: 12px 14px; font-size: 16px; font-family: inherit; background: transparent; }
.apple-input-group input:focus { outline: none; }
.apple-btn { width: 100%; padding: 13px 16px; border: none; border-radius: var(--apple-radius-sm); background: var(--apple-accent); color: #fff; font-size: 16px; font-weight: 500; font-family: inherit; cursor: pointer; transition: background .15s ease, transform .05s ease; }
.apple-btn:hover { background: var(--apple-accent-hover); }
.apple-btn:active { transform: scale(0.99); }
.apple-link { color: var(--apple-accent); text-decoration: none; font-size: 14px; }
.apple-link:hover { text-decoration: underline; }
.apple-tabs { display: flex; gap: 8px; background: #f0f0f2; border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.apple-tab { flex: 1; text-align: center; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--apple-secondary); text-decoration: none; transition: background .15s ease, color .15s ease; }
.apple-tab.active { background: #fff; color: var(--apple-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.apple-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--apple-tertiary); }
.apple-alert { padding: 10px 14px; border-radius: var(--apple-radius-sm); font-size: 14px; margin-bottom: 16px; }
.apple-alert.success { background: #e8f5e9; color: #2e7d32; }
.apple-alert.error { background: #ffebee; color: #c62828; }
.apple-shell { min-height: 100vh; background: #ffffff; padding: 14px 12px 96px; max-width: 480px; margin: 0 auto; }
.apple-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.apple-header .brand { display: flex; align-items: center; gap: 10px; }
.apple-header .brand img { height: 32px; width: auto; }
.apple-header .brand .id { font-size: 13px; color: var(--apple-secondary); }
.apple-balance-card { background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%); color: #fff; border-radius: var(--apple-radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--apple-shadow-lg); }
.apple-balance-card .label { font-size: 13px; opacity: 0.75; margin-bottom: 4px; }
.apple-balance-card .amount { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.apple-balance-card .row { display: flex; gap: 12px; margin-top: 16px; }
.apple-balance-card .btn { flex: 1; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.15); color: #fff; text-align: center; text-decoration: none; font-size: 14px; font-weight: 500; backdrop-filter: blur(8px); transition: background .15s ease; }
.apple-balance-card .btn:hover { background: rgba(255,255,255,0.25); }
.apple-section-title { font-size: 18px; font-weight: 600; margin: 20px 0 12px; letter-spacing: -0.01em; }
.apple-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.apple-tile { background: var(--apple-card); border-radius: var(--apple-radius); padding: 16px; box-shadow: var(--apple-shadow); text-decoration: none; color: var(--apple-text); display: flex; flex-direction: column; gap: 8px; transition: transform .12s ease, box-shadow .12s ease; }
.apple-tile:hover { transform: translateY(-2px); box-shadow: var(--apple-shadow-lg); }
.apple-tile .icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f0f0f2; font-size: 20px; }
.apple-tile .title { font-size: 14px; font-weight: 500; }
.apple-tile .sub { font-size: 12px; color: var(--apple-secondary); }
.apple-vip-card { background: var(--apple-card); border-radius: var(--apple-radius); padding: 16px; box-shadow: var(--apple-shadow); margin-bottom: 12px; display: flex; align-items: center; gap: 14px; }
.apple-vip-card img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.apple-vip-card .info { flex: 1; }
.apple-vip-card .name { font-weight: 600; font-size: 15px; }
.apple-vip-card .price { color: var(--apple-accent); font-weight: 600; font-size: 14px; }
.apple-admin { display: flex; min-height: 100vh; background: var(--apple-bg); font-family: var(--apple-font); }
.apple-admin-sidebar { width: 240px; background: #fff; border-right: 1px solid var(--apple-border); padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.apple-admin-sidebar .brand { font-size: 18px; font-weight: 600; margin-bottom: 24px; padding: 0 8px; }
.apple-admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--apple-text); text-decoration: none; font-size: 14px; margin-bottom: 2px; transition: background .12s ease; }
.apple-admin-sidebar a:hover { background: #f0f0f2; }
.apple-admin-sidebar a.active { background: #e8f0fe; color: var(--apple-accent); }
.apple-admin-main { flex: 1; padding: 28px 32px; }
.apple-admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.apple-admin-topbar h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.apple-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.apple-kpi { background: #fff; border-radius: var(--apple-radius); padding: 20px; box-shadow: var(--apple-shadow); }
.apple-kpi .label { font-size: 13px; color: var(--apple-secondary); margin-bottom: 6px; }
.apple-kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.apple-kpi .icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #f0f0f2; font-size: 18px; margin-bottom: 10px; }
.apple-card { overflow-x: auto; }
.apple-banner { width: 100%; height: auto; max-height: 180px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--apple-radius-lg); display: block; }
.apple-table-wrap table { min-width: 360px; }
.apple-collapse { background: var(--apple-card); border-radius: var(--apple-radius); box-shadow: var(--apple-shadow); margin-bottom: 12px; overflow: hidden; }
.apple-collapse > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.apple-collapse > summary::-webkit-details-marker { display: none; }
.apple-collapse > summary::after { content: "›"; font-size: 20px; color: var(--apple-secondary); transition: transform .2s ease; }
.apple-collapse[open] > summary::after { transform: rotate(90deg); }
.apple-collapse .apple-collapse-body { padding: 0 16px 16px; font-size: 13px; color: var(--apple-secondary); line-height: 1.6; }
.apple-shell { padding-bottom: 96px; }
@media (max-width: 480px) {
    .apple-shell { padding: 14px 12px 96px; }
    .apple-card { padding: 20px 18px; }
    .apple-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .apple-vip-card { flex-direction: column; align-items: stretch; }
    .apple-balance-card .amount { font-size: 26px; }
    .apple-tabs { gap: 6px; }
    .apple-tab { font-size: 13px; padding: 7px 8px; }
}
@media (min-width: 768px) {
    .apple-shell { max-width: 520px; }
}
.apple-tabbar { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }


/* Admin overrides */
.apple-admin .card { border-radius: 12px; border: 1px solid var(--apple-border); box-shadow: var(--apple-shadow); font-family: var(--apple-font); }
.apple-admin .card-body { font-family: var(--apple-font); }
.apple-admin .kpi-card h3 { font-weight: 600; letter-spacing: -0.01em; }
.apple-admin .badge-circle { border-radius: 50%; }
.apple-admin .table { font-family: var(--apple-font); }
/* Admin Apple overrides (global) */
.apple-admin .btn { border-radius: 10px; font-family: var(--apple-font); font-weight: 500; }
.apple-admin .btn-primary { background: var(--apple-accent); border-color: var(--apple-accent); }
.apple-admin .btn-primary:hover { background: var(--apple-accent-hover); border-color: var(--apple-accent-hover); }
.apple-admin .btn-success { background: #34c759; border-color: #34c759; }
.apple-admin .btn-danger { background: #ff3b30; border-color: #ff3b30; }
.apple-admin .btn-warning { background: #ff9500; border-color: #ff9500; color: #fff; }
.apple-admin .btn-info { background: #5ac8fa; border-color: #5ac8fa; color: #fff; }
.apple-admin .form-control, .apple-admin .custom-select, .apple-admin select.form-control { border-radius: 10px; border: 1px solid var(--apple-border); font-family: var(--apple-font); padding: 9px 12px; }
.apple-admin .form-control:focus, .apple-admin select.form-control:focus { border-color: var(--apple-accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
.apple-admin .table thead th { font-weight: 600; color: var(--apple-secondary); border-bottom: 1px solid var(--apple-border); background: #f5f5f7; }
.apple-admin .table tbody tr:hover { background: #fafafa; }
.apple-admin .table td, .apple-admin .table th { vertical-align: middle; }
.apple-admin .badge { border-radius: 8px; font-weight: 500; }
.apple-admin .alert { border-radius: 10px; border: none; }
.apple-admin .modal-content { border-radius: 16px; border: none; box-shadow: var(--apple-shadow-lg); font-family: var(--apple-font); }
.apple-admin .modal-header { border-bottom: 1px solid var(--apple-border); }
.apple-admin .modal-footer { border-top: 1px solid var(--apple-border); }
.apple-admin .page-link { border-radius: 8px; color: var(--apple-accent); border: none; margin: 0 2px; }
.apple-admin .page-item.active .page-link { background: var(--apple-accent); border-color: var(--apple-accent); }
.apple-admin h1, .apple-admin h2, .apple-admin h3, .apple-admin h4, .apple-admin h5 { letter-spacing: -0.01em; font-weight: 600; }
.apple-admin .card-header { border-bottom: 1px solid var(--apple-border); background: transparent; }
.apple-admin .card-title { font-weight: 600; }
.apple-admin .input-group-text { border-radius: 10px 0 0 10px; border: 1px solid var(--apple-border); background: #f5f5f7; }
.apple-admin .dataTables_wrapper .dataTables_filter input { border-radius: 10px; border: 1px solid var(--apple-border); padding: 6px 10px; }
.apple-admin .dataTables_wrapper .dataTables_length select { border-radius: 8px; border: 1px solid var(--apple-border); }

.apple-admin .content-body { padding: 0; }

/* Admin sidebar section headers */
.apple-admin-sidebar .apple-admin-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 16px 8px 6px;
}
.apple-admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
@media (max-width: 768px) {
    .apple-admin { flex-direction: column; }
    .apple-admin-sidebar { width: 100%; height: auto; position: relative; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
    .apple-admin-sidebar .brand { width: 100%; margin-bottom: 8px; }
    .apple-admin-sidebar .apple-admin-section { width: 100%; margin: 8px 0 4px; }
    .apple-admin-main { padding: 16px; }
}

