/* Apple Design System V8 - Clean Build */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Default - Apple Clean */
    --bg-body: #F5F5F7;
    --bg-card: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --accent: #0071E3;
    --danger: #FF3B30;
    --success: #34C759;
    --warning: #FF9F0A;
    --border-radius: 24px;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    --card-border: 1px solid rgba(0, 0, 0, 0.06);
    --glass-filter: none;
    --focus-ring: 0 0 0 4px rgba(0, 113, 227, 0.15);
    --input-bg: #F5F5F7;
    --divider: rgba(0, 0, 0, 0.08);
}

/* Clay-morphism Theme */
[data-theme="clay"] {
    --bg-body: #ebecf0;
    --bg-card: #ebecf0;
    --text-primary: #44476a;
    --text-secondary: #7a7c9f;
    --accent: #6d5dfc;
    --danger: #e45a5a;
    --success: #3ddc84;
    --warning: #f0a500;
    --border-radius: 32px;
    --card-shadow: 8px 8px 16px #D1D9E6, -8px -8px 16px #FFFFFF;
    --card-border: 2px solid rgba(255, 255, 255, 0.5);
    --glass-filter: none;
    --focus-ring: 0 0 0 4px rgba(109, 93, 252, 0.2);
    --input-bg: #ebecf0;
    --divider: rgba(0, 0, 0, 0.1);
}

/* Water-morphism Theme */
[data-theme="water"] {
    --bg-body: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
    --bg-card: rgba(255, 255, 255, 0.35);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent: #2563eb;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --border-radius: 24px;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.17);
    --card-border: 1px solid rgba(255, 255, 255, 0.48);
    --glass-filter: blur(12px);
    --focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.2);
    --input-bg: rgba(255, 255, 255, 0.5);
    --divider: rgba(255, 255, 255, 0.2);
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background 0.5s ease;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 100px;
}

/* Headers */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
}

.hero-sub {
    font-size: 19px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 0;
}

/* Components */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: var(--card-border);
    backdrop-filter: var(--glass-filter);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    /* Need to adjust for clay? Clay usually inset on click, output on hover/default */
}

/* Clay specific inputs */
[data-theme="clay"] .card {
    box-shadow: 9px 9px 16px rgb(163, 177, 198, 0.6), -9px -9px 16px rgba(255, 255, 255, 0.5);
}

[data-theme="clay"] input,
[data-theme="clay"] select {
    background: #ebecf0 !important;
    box-shadow: inset 5px 5px 10px #babecc, inset -5px -5px 10px #ffffff !important;
    border: none !important;
}

[data-theme="clay"] .btn {
    box-shadow: 6px 6px 12px #babecc, -6px -6px 12px #ffffff;
}

[data-theme="clay"] .btn:active {
    box-shadow: inset 4px 4px 8px #babecc, inset -4px -4px 8px #ffffff;
    transform: none;
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Pill Buttons */
.btn-pill {
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    text-align: center;
}

.btn-pill:hover {
    transform: translateY(-1px);
}

.btn-pill:active {
    transform: scale(0.97);
}

.btn-pill-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.25);
}

.btn-pill-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
}

.btn-pill-dark {
    background: var(--text-primary);
    color: white;
}

/* Inputs */
input,
textarea,
select {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--input-bg);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--accent) !important;
}

/* Lists & Grids */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: 0.1s;
}

.list-item:last-child {
    border: none;
}

.list-item:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    background: #E5E5EA;
    color: var(--text-secondary);
}

.badge.green {
    background: #daf8e1;
    color: var(--success);
}

.badge.blue {
    background: #d0e7ff;
    color: var(--accent);
}

/* Navigation Dock */
.dock-wrap {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 100;
}

.dock {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4px;
    border-radius: 16px;
    display: flex;
    gap: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dock-link {
    text-decoration: none;
    padding: 12px 28px;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 99px;
    transition: 0.2s;
}

.dock-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
}

.dock-link.active {
    background: white;
    color: black;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Utils */
.hidden {
    display: none !important;
}

.blur-content {
    filter: blur(6px);
    user-select: none;
}

.blur-content.reveal {
    filter: none;
}

.text-danger {
    color: var(--danger);
}

/* --- Extracted from team.php --- */

/* CSS Variables for Clean Look */


.team-page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Control Bar */
.control-bar {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: transparent;
    border-radius: 10px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    width: 40px;
    /* Collapsed width */
    overflow: hidden;
}

.search-wrapper.expanded {
    width: 300px;
    background: #fff;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.search-wrapper input {
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.search-wrapper.expanded input {
    opacity: 1;
    pointer-events: auto;
}

.filter-wrapper select {
    height: 48px;
    padding: 0 32px 0 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    min-width: 160px;
    transition: all 0.2s;
}

.filter-wrapper select:hover {
    border-color: #d2d2d7;
}

.filter-wrapper select:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.view-toggle {
    display: flex;
    background: var(--bg-body);
    padding: 4px;
    border-radius: 10px;
    height: 48px;
}

.toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.user-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: transparent;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.role-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.card-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.user-card:hover .card-actions {
    opacity: 1;
}

/* List Layout */
.list-layout {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.list-row {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr 1fr;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    align-items: center;
    transition: background 0.1s;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row:hover {
    background: #f9f9f9;
}

.list-header {
    background: var(--bg-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Utility */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.delete-btn {
    background: #fff0f0;
    color: #d70015;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #d70015;
    color: white;
}

.pagination-bar {
    margin-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--text-secondary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: default;
}


.modal-input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: white;
    color: #1d1d1f;
}

.modal-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Extracted from subscription.php --- */

/* Clean, Professional Design System */


body {
    background: var(--bg-body);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    text-align: left;
}

.header-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.header-sub {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.status-pill {
    background: var(--bg-body);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Managed Banner */
.managed-banner {
    background: #E8F2FF;
    border: 1px solid #CDE4FF;
    color: #004085;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Gamification Section (Aligned) */
.rewards-section {
    background: #1C1C1E;
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.rewards-left {
    border-right: 1px solid #333;
    padding-right: 40px;
}

.rewards-title {
    color: #FFD60A;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    margin-bottom: 5px;
}

.rewards-balance {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin: 10px 0;
}

.rewards-input {
    background: #2C2C2E;
    border: 1px solid #3A3A3C;
    color: white;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-rewards {
    background: #FFD60A;
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.btn-redeem {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

/* Pricing Grid (Strict Alignment) */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
    align-items: start;
}

.plan-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    border: var(--card-border);
    transition: transform 0.2s;
    position: relative;
}

.plan-card.featured {
    border: 2px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.1);
    transform: scale(1.02);
    z-index: 10;
}

.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.plan-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.plan-period {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: normal;
}

.plan-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 25px;
    min-height: 40px;
}

.btn-plan {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 25px;
    transition: 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:disabled {
    background: var(--success);
    cursor: default;
}

.btn-dark {
    background: var(--text-primary);
    color: white;
}

.btn-dark:disabled {
    background: var(--success);
    cursor: default;
}

.btn-outline {
    background: white;
    border: var(--card-border);
    color: var(--text-primary);
}

.btn-outline:disabled {
    background: var(--bg-body);
    color: var(--text-secondary);
    border-color: transparent;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 10px 0;
    border-bottom: 1px solid #F2F2F7;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features-list li:last-child {
    border-bottom: none;
}

.check-icon {
    color: var(--success);
    font-weight: bold;
}

/* Builder Section */
.builder-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    border: var(--card-border);
    margin-bottom: 50px;
}

.range-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.range-label {
    font-weight: 600;
    font-size: 14px;
}

/* Result Strip */
.result-bar {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* History Table */
.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    border: var(--card-border);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #F2F2F7;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.history-table td {
    padding: 15px;
    border-bottom: 1px solid #F2F2F7;
    font-size: 14px;
}