:root {
    --font-en: 'Poppins', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

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

body {
    font-family: var(--font-en);
    min-height: 100vh;
    background: radial-gradient(circle at top, #0d365e 0%, #0A2540 60%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

html[dir="rtl"] body {
    font-family: var(--font-ar);
}

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

.container {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.03);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    backdrop-filter: blur(10px);
    animation: fadeUp 0.6s ease-out forwards;
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-family: var(--font-en); 
}

.brand-title span {
    background: linear-gradient(90deg, #2F80ED, #00C2A8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.brand span {
    color: #00C2A8;
}

p.subtitle {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 30px;
}

.error {
    color: #ff8a8a;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: start; 
}

/* NEW: Success message styling for dark mode */
.success {
    color: #69f0ae;
    background: rgba(105, 240, 174, 0.1);
    border: 1px solid rgba(105, 240, 174, 0.2);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: start;
}

form {
    display: flex;
    flex-direction: column;
}

/* 1. Target ONLY inputs that belong to our specific layout structure */
form > input,
.form-group > input,
.password-wrapper > input {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    transition: all 0.3s ease;
    text-align: start; 
    font-family: inherit; 
}

/* 2. Target placeholders for our inputs */
form > input::placeholder,
.form-group > input::placeholder,
.password-wrapper > input::placeholder {
    color: #64748b;
}

/* 3. Target focus states for our inputs */
form > input:focus,
.form-group > input:focus,
.password-wrapper > input:focus {
    border-color: #00C2A8;
    box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-inline-end: 45px; 
}

.toggle-password {
    position: absolute;
    inset-inline-end: 12px; 
    top: 38%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #00C2A8;
}

.forgot-link {
    text-align: end; 
    margin-top: -5px;
    margin-bottom: 20px;
    font-size: 13px;
}

.forgot-link a, .register-link a {
    color: #00C2A8;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-link a:hover, .register-link a:hover {
    color: #2F80ED;
}

.g-recaptcha {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    transform: scale(0.95);
    transform-origin: center;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #2F80ED, #00C2A8);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: opacity 0.3s, transform 0.1s, box-shadow 0.3s;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 194, 168, 0.2);
    font-family: inherit;
}

.primary-btn:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(0, 194, 168, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

.register-link {
    font-size: 14px;
    color: #94a3b8;
}

/* =========================================
   Status Pages (Verify Email, Reset Sent)
   ========================================= */
.status-container {
    padding: 50px 30px;
}

.status-icon {
    display: flex;
    justify-content: center;
    margin: 30px 0 20px 0;
}

.success-icon svg {
    color: #00C2A8;
    filter: drop-shadow(0 0 10px rgba(0, 194, 168, 0.4));
}

.error-icon svg {
    color: #ff8a8a;
    filter: drop-shadow(0 0 10px rgba(255, 138, 138, 0.4));
}

.status-heading {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.status-message {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Make primary button behave properly as an <a> tag */
a.link-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.status-actions {
    font-size: 14px;
    color: #94a3b8;
}

.status-actions a {
    color: #00C2A8;
    text-decoration: none;
    transition: color 0.3s;
}

.status-actions a:hover {
    color: #2F80ED;
}

.status-actions .divider {
    margin: 0 10px;
    opacity: 0.5;
}

/* =========================================
   Dashboard Layout & Components
   ========================================= */

/* Adjust body for dashboard (allows scrolling, removes strict centering) */
body.dashboard-body {
    display: block;
    padding: 0;
    background: #0A2540; /* Solid background for larger screens */
}

/* Header */
.dashboard-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header .brand-title {
    font-size: 24px;
    margin: 0;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.greeting {
    font-size: 14px;
    color: #cbd5e1;
    display: none; /* Hide on mobile to save space */
}

@media (min-width: 768px) {
    .greeting { display: block; }
}

/* Dashboard Main Content Area */
.dashboard-main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    animation: fadeUp 0.6s ease-out forwards;
}

/* Buttons */
.secondary-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
    border: 1px solid transparent;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.outline-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.outline-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
}

a.inline-btn {
    display: inline-block;
    width: auto;
    padding: 10px 24px;
    margin-bottom: 0;
}

/* Cards */
.dash-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.card-body {
    padding: 25px;
}

/* Subscription Specifics */
.sub-card {
    border-inline-start: 4px solid #475569; /* Default */
}
.sub-card.active { border-inline-start-color: #00C2A8; }
.sub-card.expired { border-inline-start-color: #ffc107; }
.sub-card.canceled { border-inline-start-color: #ff8a8a; }

.status-pill {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.active-pill { background: rgba(0, 194, 168, 0.2); color: #00C2A8; }

.sub-detail {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 15px;
}

/* Store Stats Header */
.summary-header {
    flex-wrap: wrap;
    gap: 15px;
}

.store-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 14px;
}

.total-stat {
    color: #fff;
    padding-inline-start: 15px;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
}

/* Badges */
.platform-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.badge-salla { background: #13887d; } /* Salla brand color adjusted for dark mode */
.badge-zid { background: #8432b0; } /* Zid brand color adjusted for dark mode */

/* Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scroll on mobile */
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
    white-space: nowrap; /* Prevents weird wrapping on small screens */
}

.styled-table th, .styled-table td {
    padding: 16px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.styled-table th {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
}

.styled-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.styled-table td {
    font-size: 14px;
    color: #cbd5e1;
}

.highlight-cell { color: #fff !important; font-weight: 500; }
.mono-text { font-family: monospace; color: #94a3b8; }

/* Text Colors */
.success-text { color: #00C2A8; }
.warn-text { color: #ffc107; }
.error-text { color: #ff8a8a; }

.empty-state {
    padding: 40px;
    text-align: center;
    color: #64748b;
}

/* Install Prompts */
.install-prompt {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 50px;
}

.install-prompt h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
}

.install-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.install-link {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    color: #fff;
    transition: transform 0.2s, opacity 0.2s;
}

.install-link:hover { opacity: 0.9; transform: translateY(-2px); }
.salla-link { background: #13887d; }
.zid-link { background: #8432b0; }

.install-note {
    font-size: 13px;
    color: #64748b;
}

/* =========================================
   Forms & Settings Specifics
   ========================================= */

/* Constrain the width of the settings page so forms don't stretch too wide */
.settings-container {
    max-width: 700px;
}

.settings-header {
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
    text-align: start;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
}

/* Specific styling for disabled inputs (like the email address) */
input.input-disabled {
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    border-color: transparent;
    cursor: not-allowed;
}
input.input-disabled:focus {
    box-shadow: none;
    border-color: transparent;
}

select.styled-select {
    width: 100%;
    padding: 14px;
    padding-right: 40px; /* NEW: Keeps text from overlapping the arrow */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' 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 14px center; /* NEW: Anchors the arrow to the right and centers vertically */
}

/* NEW: RTL Support for Arabic Dashboards */
[dir="rtl"] select.styled-select {
    background-position: left 14px center; /* Moves arrow to the left */
    padding-right: 14px; /* Resets right padding */
    padding-left: 40px; /* Adds padding to the left */
}

select.styled-select:focus {
    border-color: #00C2A8;
    box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.15);
    background-color: rgba(0, 0, 0, 0.3);
}

/* Logical property to place the dropdown arrow on the correct side */
html[dir="ltr"] select.styled-select {
    background-position: right 15px center;
    padding-right: 40px;
}

select.styled-select option {
    background: #0A2540;
    color: #fff;
}

/* =========================================
   Billing & Manage Subscription Specifics
   ========================================= */

.billing-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 14px;
    color: #94a3b8;
}

.detail-value {
    font-size: 16px;
    color: #fff;
}

.action-row {
    margin-top: 20px;
}

/* Extra status pill colors */
.warn-pill { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.error-pill { background: rgba(255, 138, 138, 0.2); color: #ff8a8a; }

/* Utilities */
.font-bold { font-weight: 600; }

/* =========================================
   Pricing & Checkout Specifics
   ========================================= */

/* Center specific headers */
.text-center {
    text-align: center;
}

.plans-container {
    max-width: 1000px;
}

/* Pricing Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.pricing-card {
    text-align: center;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 194, 168, 0.15);
    border-color: rgba(0, 194, 168, 0.4);
}

.pricing-name {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.pricing-price-wrapper {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 5px;
}

.pricing-price {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(90deg, #2F80ED, #00C2A8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-currency {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 600;
}

.pricing-interval {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 25px;
}

.pricing-desc {
    font-size: 15px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 30px;
    flex-grow: 1; /* Pushes the button to the bottom if cards are different heights */
}

.full-width-btn {
    width: 100%;
    margin-bottom: 0;
}

/* Checkout Layout */
.checkout-wrapper {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeUp 0.6s ease-out forwards;
}

.checkout-summary {
    text-align: center;
    margin-bottom: 30px;
}

.checkout-summary h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.checkout-summary h3 {
    font-size: 20px;
    color: #cbd5e1;
    margin-bottom: 10px;
    font-weight: 500;
}

.checkout-summary .price-tag {
    font-size: 22px;
    color: #00C2A8;
    font-weight: 700;
}

/* Moyasar Wrapper - intentionally light to support their native Apple Pay/CC UI */
.moyasar-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

/* Force Moyasar's internal form spacing to look a bit tighter inside our card */
.moyasar-container .mysr-form {
    margin-bottom: 0 !important;
}

.checkout-actions {
    text-align: center;
}
/* =========================================
   Pricing & Checkout Specifics
   ========================================= */

/* Center specific headers */
.text-center {
    text-align: center;
}

.plans-container {
    max-width: 1000px;
}

/* Pricing Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.pricing-card {
    text-align: center;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 194, 168, 0.15);
    border-color: rgba(0, 194, 168, 0.4);
}

.pricing-name {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.pricing-price-wrapper {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 5px;
}

.pricing-price {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(90deg, #2F80ED, #00C2A8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-currency {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 600;
}

.pricing-interval {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 25px;
}

.pricing-desc {
    font-size: 15px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 30px;
    flex-grow: 1; /* Pushes the button to the bottom if cards are different heights */
}

.full-width-btn {
    width: 100%;
    margin-bottom: 0;
}

/* Checkout Layout */
.checkout-wrapper {
    max-width: 500px;
    margin: 0 auto;
    animation: fadeUp 0.6s ease-out forwards;
}

.checkout-summary {
    text-align: center;
    margin-bottom: 30px;
}

.checkout-summary h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.checkout-summary h3 {
    font-size: 20px;
    color: #cbd5e1;
    margin-bottom: 10px;
    font-weight: 500;
}

.checkout-summary .price-tag {
    font-size: 22px;
    color: #00C2A8;
    font-weight: 700;
}

/* Seamless Moyasar Wrapper (Removed the old modal/box-shadow look) */
#moyasar-payment-form {
    background: rgba(255, 255, 255, 0.03); /* Subtle dark card background */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.checkout-actions {
    text-align: center;
}

/* =========================================
   Danger Button & Alert Styling
   ========================================= */

.danger-btn {
    background: rgba(255, 107, 107, 0.1);
    color: #ff8a8a;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.danger-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff8a8a;
}

/* Ensure global alert containers handle error states uniformly */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
}

.alert.error {
    color: #ff8a8a;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* =========================================
   Custom Modal Dialogs
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 37, 64, 0.85); /* Deep dark blue overlay */
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #0d365e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 35px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy pop-in */
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-icon {
    color: #ff6b6b;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.modal-text {
    font-size: 15px;
    color: #94a3b8;
    margin-bottom: 30px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.modal-actions button {
    margin-bottom: 0; /* Prevents double margins */
    flex: 1; /* Makes buttons equal width */
    padding: 12px;
}

/* Unique red gradient for the confirm delete button */
.danger-bg-btn {
    background: linear-gradient(90deg, #ff4b4b, #ff6b6b);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.danger-bg-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* =========================================
   Admin Dashboard Specifics
   ========================================= */

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 0; /* overrides .dash-card default */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.users-icon { background: rgba(47, 128, 237, 0.15); color: #2F80ED; }
.subs-icon { background: rgba(0, 194, 168, 0.15); color: #00C2A8; }
.rev-icon { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.plans-icon { background: rgba(132, 50, 176, 0.15); color: #c084fc; }

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}

.currency-tag {
    font-size: 16px;
    color: #94a3b8;
    font-weight: 500;
}

.stat-label {
    font-size: 13px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Admin Modules Menu Grid */
.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.menu-card {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    margin-bottom: 0;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.menu-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 194, 168, 0.4);
    box-shadow: 0 10px 30px rgba(0, 194, 168, 0.1);
}

.menu-card-content h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.menu-card:hover .menu-card-content h3 {
    color: #00C2A8;
}

.menu-card-content p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.menu-arrow {
    color: #475569;
    font-size: 24px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.menu-card:hover .menu-arrow {
    color: #00C2A8;
    transform: translateX(4px);
}

.danger-hover:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
}

/* =========================================
   Admin Data Tables & Controls
   ========================================= */

/* Search Toolbar */
.admin-toolbar {
    margin-bottom: 25px;
}

.admin-search-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Force the input to take up the remaining space and align heights */
.admin-search-form input[type="text"] {
    flex-grow: 1;
    margin-bottom: 0;
    height: 44px; /* Matches standard button height */
}

.admin-search-form .inline-btn {
    height: 44px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table Actions Flexbox */
.action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Pagination Controls */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.admin-pagination a {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.admin-pagination a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-pagination a.active {
    background: rgba(0, 194, 168, 0.15);
    color: #00C2A8;
    border-color: rgba(0, 194, 168, 0.3);
    font-weight: 700;
}

/* =========================================
   Custom Toggle Switches (Admin/Settings)
   ========================================= */

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

/* The switch - the box around the slider */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

/* Hide default HTML checkbox */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider track */
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* The slider knob */
.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #cbd5e1;
    transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
}

/* Checked state */
.toggle-switch input:checked + .slider {
    background-color: #00C2A8;
    border-color: #00C2A8;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #fff;
}

/* Focus state for accessibility */
.toggle-switch input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.2);
}

/* =========================================
   Textarea Override
   ========================================= */

.form-group > textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    transition: all 0.3s ease;
    font-family: inherit; 
    resize: vertical; /* Allows user to drag height, but locks width */
}

.form-group > textarea::placeholder {
    color: #64748b;
}

.form-group > textarea:focus {
    border-color: #00C2A8;
    box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

/* =========================================
   Stores Filter & Refresh Overrides
   ========================================= */

.store-filters {
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

.store-filters input[type="text"] {
    min-width: 250px;
}

/* Constrain the selects so they don't stretch fully */
.filter-select {
    width: auto !important;
    min-width: 150px;
    height: 44px;
    margin-bottom: 0;
}

.refresh-action-btn {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.refresh-action-btn:hover {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}

/* =========================================
   Terminal Log Viewer
   ========================================= */

.terminal-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #1e293b;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.terminal-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dots .red { background: #ff5f56; }
.terminal-dots .yellow { background: #ffbd2e; }
.terminal-dots .green { background: #27c93f; }

.terminal-title {
    color: #64748b;
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.terminal-body {
    padding: 20px;
    height: 65vh; /* Locks the height so the page doesn't scroll infinitely */
    overflow-y: auto; /* Adds a scrollbar just for the log content */
}

/* Custom Scrollbar for Terminal */
.terminal-body::-webkit-scrollbar {
    width: 10px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #0f172a;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

.terminal-body pre {
    margin: 0;
    color: #a7f3d0; /* Soft Matrix Green */
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap; /* Forces long JSON strings to wrap to the next line */
    word-wrap: break-word;
}