/* ============================================
   Apple-Inspired Design System
   ============================================ */

/* ── Section ── */
.as-section {
    margin-bottom: 40px;
}
.as-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 0 4px;
}
.as-section-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255, 107, 0, 0.1);
    color: #ff6b00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.as-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}
.as-section-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin: 2px 0 0;
}

/* ── Card ── */
.as-card {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.as-card-plain {
    box-shadow: none;
    border-color: rgba(255,255,255,0.04);
}
.as-card-body {
    padding: 28px 32px;
}
.as-card-footer {
    padding: 16px 32px;
    border-top: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.015);
}

/* ── Rows ── */
.as-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.as-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.as-row-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}
.as-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 24px 0;
}

/* ── Field ── */
.as-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.as-field-btn {
    justify-content: flex-end;
    padding-top: 22px;
}
.as-field-note {
    justify-content: center;
}
.as-field-inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* ── Label ── */
.as-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

/* ── Input ── */
.as-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
}
.as-input:focus {
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
    background: rgba(255,255,255,0.06);
}
.as-input::placeholder {
    color: rgba(255,255,255,0.2);
}
.as-input-mono {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ── Input Group ── */
.as-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.as-input-prefix {
    position: absolute;
    left: 14px;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    pointer-events: none;
    z-index: 1;
}
.as-input-prefixed {
    padding-left: 32px;
}

/* ── Select ── */
.as-select-wrap {
    position: relative;
}
.as-select {
    padding-right: 36px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.as-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    pointer-events: none;
}

/* ── Hint ── */
.as-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    line-height: 1.4;
}

/* ── Button ── */
.as-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    background: linear-gradient(135deg, #ff6b00, #e65e00);
    color: #000;
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.25);
    letter-spacing: 0.01em;
}
.as-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.35);
}
.as-btn:active {
    transform: scale(0.97);
}
.as-btn i {
    font-size: 14px;
}
.as-btn-secondary {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8);
    box-shadow: none;
    border: 1.5px solid rgba(255,255,255,0.08);
}
.as-btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    box-shadow: none;
    transform: none;
}

/* ── Badge ── */
.as-badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.as-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.as-badge:hover {
    border-color: rgba(255, 107, 0, 0.3);
    color: rgba(255,255,255,0.6);
}
.as-badge.active {
    background: rgba(255, 107, 0, 0.12);
    border-color: rgba(255, 107, 0, 0.25);
    color: #ff6b00;
}

/* ── Stat Cards ── */
.as-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.as-stat-card {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.as-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.1);
}
.as-stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.as-stat-card:hover .as-stat-icon {
    transform: scale(1.1);
}
.as-stat-icon.orange { background: rgba(255,107,0,0.1); color: #ff6b00; }
.as-stat-icon.green { background: rgba(16,185,129,0.1); color: #10b981; }
.as-stat-icon.blue { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.as-stat-icon.yellow { background: rgba(245,158,11,0.1); color: #f59e0b; }
.as-stat-icon.red { background: rgba(239,68,68,0.1); color: #ef4444; }

.as-stat-content { flex: 1; }
.as-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.as-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.01em;
}
.as-stat-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    margin-top: 6px;
    display: block;
}

/* ── Link button ── */
.as-link {
    color: #ff6b00;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
    opacity: 0.8;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.as-link:hover {
    color: #fff;
    opacity: 1;
    text-decoration: none;
}

/* ── Tip badge ── */
.as-tip {
    background: rgba(255,107,0,0.08);
    color: #ff6b00;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-block;
}
.as-odds {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}

/* ── Page wrapper ── */
.as-page {
    max-width: 820px;
    margin: 0 auto;
}

/* ── Apple Table ── */
.as-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.as-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.as-table thead th {
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.as-table tbody td {
    padding: 14px 18px;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
.as-table tbody tr:last-child td {
    border-bottom: none;
}
.as-table tbody tr:hover {
    background: rgba(255,255,255,0.015);
}

/* ── Table Badges ── */
.as-table-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.as-table-badge.success {
    background: rgba(16,185,129,0.1);
    color: #10b981;
}
.as-table-badge.danger {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.as-table-badge.warning {
    background: rgba(245,158,11,0.1);
    color: #f59e0b;
}
.as-table-badge.info {
    background: rgba(14,165,233,0.1);
    color: #0ea5e9;
}
.as-table-badge.primary {
    background: rgba(255,107,0,0.1);
    color: #ff6b00;
}
.as-table-badge.secondary {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
}

/* ── Action Buttons ── */
.as-action-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.as-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.as-action-btn.edit {
    background: rgba(255,107,0,0.08);
    color: #ff6b00;
}
.as-action-btn.edit:hover {
    background: rgba(255,107,0,0.15);
    color: #ff6b00;
    transform: scale(1.05);
}
.as-action-btn.delete {
    background: rgba(239,68,68,0.08);
    color: #ef4444;
}
.as-action-btn.delete:hover {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    transform: scale(1.05);
}
.as-action-btn.info {
    background: rgba(14,165,233,0.08);
    color: #0ea5e9;
}
.as-action-btn.info:hover {
    background: rgba(14,165,233,0.15);
    color: #0ea5e9;
    transform: scale(1.05);
}
.as-action-btn.warning {
    background: rgba(245,158,11,0.08);
    color: #f59e0b;
}
.as-action-btn.warning:hover {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    transform: scale(1.05);
}
.as-action-btn.success {
    background: rgba(16,185,129,0.08);
    color: #10b981;
}
.as-action-btn.success:hover {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    transform: scale(1.05);
}

/* ── Empty State ── */
.as-empty {
    text-align: center;
    padding: 48px 24px;
}
.as-empty-icon {
    font-size: 36px;
    color: rgba(255,255,255,0.08);
    margin-bottom: 16px;
}
.as-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}
.as-empty-text {
    font-size: 13px;
    color: rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

/* ── Filter Bar ── */
.as-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    padding-bottom: 0;
}
.as-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}
.as-filter-group label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.3);
    margin: 0;
}
.as-filter-group .as-input {
    padding: 8px 12px;
    font-size: 13px;
}

/* ── Pill Tab Filters ── */
.as-pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 0;
}
.as-pill-tab {
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid rgba(255,255,255,0.06);
    background: transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.as-pill-tab:hover {
    border-color: rgba(255,107,0,0.3);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
.as-pill-tab.active {
    background: rgba(255,107,0,0.12);
    border-color: rgba(255,107,0,0.25);
    color: #ff6b00;
}
.as-pill-tab i {
    margin-right: 4px;
}

/* ── Pagination ── */
.as-pagination {
    display: flex;
    justify-content: center;
    padding: 20px 0 4px;
}
.as-pagination .pagination {
    margin: 0;
    gap: 4px;
}
.as-pagination .page-link {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    border-radius: 8px !important;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.as-pagination .page-link:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,107,0,0.3);
    color: #ff6b00;
}
.as-pagination .page-item.active .page-link {
    background: rgba(255,107,0,0.12);
    border-color: rgba(255,107,0,0.25);
    color: #ff6b00;
}
.as-pagination .page-item.disabled .page-link {
    background: rgba(255,255,255,0.015);
    border-color: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.15);
}

/* ── Date Separator ── */
.as-date-sep td {
    padding: 10px 18px !important;
    background: rgba(255,107,0,0.04);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ff6b00;
}

/* ── Active Row ── */
.as-active-row td {
    background: rgba(255,107,0,0.03);
}

/* ── Light Theme Overrides ── */
.light-theme .as-section-title { color: #222; }
.light-theme .as-section-subtitle { color: rgba(0,0,0,0.35); }
.light-theme .as-card {
    background: #fff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.light-theme .as-card-footer {
    border-top-color: rgba(0,0,0,0.04);
    background: rgba(0,0,0,0.015);
}
.light-theme .as-label { color: rgba(0,0,0,0.5); }
.light-theme .as-input {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
    color: #222;
}
.light-theme .as-input:focus {
    border-color: #ff6b00;
    background: rgba(255,107,0,0.03);
}
.light-theme .as-input::placeholder { color: rgba(0,0,0,0.15); }
.light-theme .as-hint { color: rgba(0,0,0,0.3); }
.light-theme .as-divider { background: rgba(0,0,0,0.05); }
.light-theme .as-btn-secondary {
    background: rgba(0,0,0,0.03);
    color: rgba(0,0,0,0.5);
    border-color: rgba(0,0,0,0.08);
}
.light-theme .as-btn-secondary:hover {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.7);
}
.light-theme .as-section-icon { background: rgba(255,107,0,0.08); }
.light-theme .as-select-arrow { color: rgba(0,0,0,0.2); }
.light-theme .as-input-prefix { color: rgba(0,0,0,0.3); }
.light-theme .as-badge {
    color: rgba(0,0,0,0.4);
    border-color: rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
}
.light-theme .as-badge:hover { border-color: rgba(255,107,0,0.3); }
.light-theme .as-badge.active {
    background: rgba(255,107,0,0.08);
    border-color: rgba(255,107,0,0.2);
    color: #ff6b00;
}
.light-theme .as-stat-card {
    background: #fff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.light-theme .as-stat-card:hover {
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.light-theme .as-stat-label { color: rgba(0,0,0,0.35); }
.light-theme .as-stat-value { color: #222; }
.light-theme .as-stat-sub { color: rgba(0,0,0,0.2); }
.light-theme .as-link:hover { color: #222; }
.light-theme .as-table thead th {
    background: rgba(0,0,0,0.02);
    color: rgba(0,0,0,0.4);
    border-bottom-color: rgba(0,0,0,0.06);
}
.light-theme .as-table tbody td {
    color: rgba(0,0,0,0.6);
    border-bottom-color: rgba(0,0,0,0.03);
}
.light-theme .as-table tbody tr:hover {
    background: rgba(0,0,0,0.01);
}
.light-theme .as-table-wrap {
    border-color: rgba(0,0,0,0.06);
}
.light-theme .as-table-badge.secondary {
    background: rgba(0,0,0,0.03);
    color: rgba(0,0,0,0.35);
}
.light-theme .as-empty-icon { color: rgba(0,0,0,0.08); }
.light-theme .as-empty-title { color: rgba(0,0,0,0.35); }
.light-theme .as-empty-text { color: rgba(0,0,0,0.2); }
.light-theme .as-pill-tab {
    border-color: rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.35);
}
.light-theme .as-pill-tab:hover {
    border-color: rgba(255,107,0,0.3);
    color: rgba(0,0,0,0.5);
}
.light-theme .as-pill-tab.active {
    background: rgba(255,107,0,0.08);
    border-color: rgba(255,107,0,0.2);
    color: #ff6b00;
}
.light-theme .as-pagination .page-link {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.4);
}
.light-theme .as-pagination .page-link:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(255,107,0,0.2);
    color: #ff6b00;
}
.light-theme .as-pagination .page-item.active .page-link {
    background: rgba(255,107,0,0.08);
    border-color: rgba(255,107,0,0.2);
    color: #ff6b00;
}
.light-theme .as-pagination .page-item.disabled .page-link {
    background: rgba(0,0,0,0.01);
    border-color: rgba(0,0,0,0.03);
    color: rgba(0,0,0,0.15);
}
.light-theme .as-filter-group label { color: rgba(0,0,0,0.25); }
.light-theme .as-date-sep td {
    background: rgba(255,107,0,0.04);
    color: #ff6b00;
}
.light-theme .as-active-row td {
    background: rgba(255,107,0,0.02);
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .as-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .as-row-2col { grid-template-columns: 1fr; }
    .as-row-3col { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .as-stat-grid { grid-template-columns: 1fr; }
    .as-card-body { padding: 20px; }
    .as-card-footer { padding: 14px 20px; }
}

/* ── Form Row ── */
.as-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 576px) {
    .as-form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Form Actions ── */
.as-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
}

/* ── Toggle Switch ── */
.as-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}
.as-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 30px;
    flex-shrink: 0;
}
.as-switch input { opacity: 0; width: 0; height: 0; }
.as-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    transition: 0.3s;
}
.as-switch-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.as-switch input:checked + .as-switch-slider {
    background: #ff6b00;
}
.as-switch input:checked + .as-switch-slider::before {
    transform: translateX(18px);
}
.light-theme .as-switch-slider { background: rgba(0,0,0,0.12); }
.light-theme .as-switch-slider::before { background: #fff; }
.light-theme .as-toggle-row .as-hint { color: rgba(0,0,0,0.3); }

/* ── Segmented Control ── */
.as-segmented-control {
    display: inline-flex;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 24px;
    width: 100%;
}
.as-segmented-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
}
.as-segmented-item.active {
    background: #1a1a1a;
    color: #ff6b00;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.as-segmented-item:hover:not(.active) {
    color: rgba(255,255,255,0.6);
}
.as-tab-panel { display: none; }
.as-tab-panel.active { display: block; }
.light-theme .as-segmented-control { background: rgba(0,0,0,0.04); }
.light-theme .as-segmented-item { color: rgba(0,0,0,0.35); }
.light-theme .as-segmented-item.active { background: #fff; color: #ff6b00; }

/* ── Progress ── */
.as-progress {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.as-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.light-theme .as-progress {
    background: rgba(0,0,0,0.06);
}
