/**
 * ============================================================================
 * Accounts Portal - Main Stylesheet
 * ============================================================================
 * 
 * Consolidated CSS for the accounts portal
 * Mobile-first, minimal design system
 * 
 * ============================================================================
 */

/* =========================================================================
   DESIGN SYSTEM - CSS Variables
   ========================================================================= */
:root {
    --black: #000000;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --success: #22c55e;
    --success-light: #dcfce7;
    --success-dark: #16a34a;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    
    --error: #ef4444;
    --error-light: #fef2f2;
    --error-dark: #dc2626;
    
    --blue: #2563eb;
    --blue-light: #dbeafe;
    
    --purple: #9333ea;
    --purple-light: #f3e8ff;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* =========================================================================
   RESET & BASE
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* =========================================================================
   LAYOUT
   ========================================================================= */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
}

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

.header-content.centered {
    justify-content: center;
}

.logo-img {
    height: 28px;
    width: auto;
}

.app-main {
    padding: 0 20px 40px;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================================================
   NAVIGATION BLOCKS
   ========================================================================= */
.nav-blocks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.nav-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--white);
    border-radius: var(--radius-lg);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all 0.15s;
    position: relative;
}

.nav-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-block.active {
    background: var(--gray-900);
    border-color: var(--gray-900);
}

.nav-block.active .nav-block-icon {
    background: rgba(255,255,255,0.2);
}

.nav-block.active .nav-block-icon svg {
    color: var(--white);
}

.nav-block.active .nav-block-label {
    color: var(--white);
}

.nav-block-icon {
    width: 44px;
    height: 44px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-block-icon svg {
    width: 22px;
    height: 22px;
    color: var(--gray-700);
}

.nav-block-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    text-align: center;
}

.nav-block-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 20px;
    height: 20px;
    background: var(--error);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* =========================================================================
   CARDS
   ========================================================================= */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.card-dark {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
    border: none;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-dark .card-title {
    color: var(--gray-400);
}

.card-no-padding {
    padding: 0;
    overflow: hidden;
}

.success-card {
    background: var(--success-light);
}

.error-card {
    background: var(--error-light);
    border: 1px solid #fecaca;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================================
   SECTION HEADERS
   ========================================================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    margin-top: 8px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.section-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
}

/* =========================================================================
   PAGE HEADERS
   ========================================================================= */
.page-header {
    margin-bottom: 20px;
}

.page-header.large {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-title.xl {
    font-size: 26px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

/* =========================================================================
   LIST ITEMS
   ========================================================================= */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}

.list-item:last-child {
    border-bottom: none;
}

.list-icon {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-icon svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.list-icon.success { background: var(--success-light); }
.list-icon.success svg { color: var(--success); }
.list-icon.warning { background: var(--warning-light); }
.list-icon.warning svg { color: var(--warning); }
.list-icon.error { background: var(--error-light); }
.list-icon.error svg { color: var(--error); }
.list-icon.blue { background: var(--blue-light); }
.list-icon.blue svg { color: var(--blue); }
.list-icon.purple { background: var(--purple-light); }
.list-icon.purple svg { color: var(--purple); }

.list-content {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.list-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.list-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    text-align: right;
}

.list-value.success { color: var(--success); }
.list-value.warning { color: var(--warning); }
.list-value.error { color: var(--error); }

.list-value.xl {
    font-size: 20px;
    font-weight: 700;
}

.list-arrow {
    color: var(--gray-300);
}

/* =========================================================================
   BADGES
   ========================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-error { background: var(--error-light); color: var(--error-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-primary {
    background: var(--black);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-outline {
    background: transparent;
    color: var(--gray-900);
    border: 1px solid var(--gray-300);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-500);
    border: 1px solid var(--gray-300);
}

.btn-full {
    width: 100%;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-icon svg {
    width: 28px;
    height: 28px;
    color: var(--gray-400);
}

.empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.empty-text {
    font-size: 14px;
    color: var(--gray-500);
}

/* =========================================================================
   FILTER BAR
   ========================================================================= */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--gray-400);
}

.filter-btn.active {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: var(--white);
}

/* =========================================================================
   SUMMARY GRID
   ========================================================================= */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    padding: 14px;
    text-align: center;
}

.summary-card.clickable {
    text-decoration: none;
    transition: all 0.15s;
}

.summary-card.clickable:hover {
    border-color: var(--gray-300);
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.summary-value.xl {
    font-size: 28px;
}

.summary-value.success { color: var(--success-dark); }
.summary-value.warning { color: var(--warning); }
.summary-value.error { color: var(--error); }

.summary-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* =========================================================================
   BUSINESS CARDS (Services page)
   ========================================================================= */
.biz-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin-bottom: 12px;
    overflow: hidden;
}

.biz-header {
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
}

.biz-header:hover {
    background: var(--gray-50);
}

.biz-header.expanded {
    border-bottom: 1px solid var(--gray-100);
}

.biz-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-600);
}

.biz-info {
    flex: 1;
    min-width: 0;
}

.biz-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.biz-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--gray-500);
}

.biz-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.biz-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.biz-chevron {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.biz-header.expanded .biz-chevron {
    transform: rotate(180deg);
}

.biz-content {
    display: none;
    padding: 0 16px 16px;
    background: var(--gray-50);
}

.biz-content.show {
    display: block;
}

.biz-section {
    margin-top: 16px;
}

.biz-section:first-child {
    margin-top: 0;
    padding-top: 16px;
}

.biz-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* =========================================================================
   CHANNEL ITEMS
   ========================================================================= */
.channel-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 12px;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.channel-icon.success { background: var(--success-light); }
.channel-icon.warning { background: var(--warning-light); }
.channel-icon.error { background: #fee2e2; }
.channel-icon.gray { background: var(--gray-100); }

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

.channel-meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.channel-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: right;
}

.channel-price-sub {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: normal;
}

/* =========================================================================
   MODULE CARDS
   ========================================================================= */
.module-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 12px;
}

.module-icon {
    width: 40px;
    height: 40px;
    background: var(--blue-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-info {
    flex: 1;
}

.module-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-900);
}

.module-desc {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.module-expiry {
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================================================
   LICENSE INFO
   ========================================================================= */
.license-info-card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
}

.license-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.license-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.license-row:first-child {
    padding-top: 0;
}

.license-label {
    font-size: 13px;
    color: var(--gray-500);
}

.license-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

/* =========================================================================
   EMPTY CHANNELS
   ========================================================================= */
.empty-channels {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 10px;
    color: var(--gray-500);
}

.empty-channels-icon {
    margin: 0 auto 8px;
}

.empty-channels-text {
    font-size: 13px;
}

.empty-channels-subtext {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* =========================================================================
   ALERT CARDS
   ========================================================================= */
.alert-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 10px;
    text-decoration: none;
}

.alert-card.error {
    background: var(--error-light);
    border: 1px solid #fecaca;
}

.alert-card.warning {
    border-left: 4px solid var(--warning);
}

.alert-card.error-border {
    border-left: 4px solid var(--error);
}

.alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon.error { background: #fee2e2; }
.alert-icon.warning { background: var(--warning-light); }

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.alert-subtitle {
    font-size: 13px;
}

.alert-subtitle.error { color: var(--error-dark); }
.alert-subtitle.muted { color: var(--gray-500); }

.alert-value {
    text-align: right;
}

.alert-amount {
    font-size: 22px;
    font-weight: 700;
}

.alert-amount.error { color: #991b1b; }

/* =========================================================================
   PLAN CARD (Subscription page)
   ========================================================================= */
.plan-header {
    background: linear-gradient(135deg, var(--gray-900) 0%, #374151 100%);
    color: white;
    padding: 24px;
}

.plan-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.plan-name {
    font-size: 28px;
    font-weight: 700;
}

.plan-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.plan-trial-notice {
    margin-top: 16px;
    padding: 14px;
    background: rgba(234,179,8,0.15);
    border-radius: 10px;
}

.plan-details {
    padding: 20px;
}

.plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.plan-detail-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.plan-detail-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.plan-detail-value.sm {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
}

/* =========================================================================
   LINK BUTTONS
   ========================================================================= */
.link-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.link-btn:hover {
    background: var(--gray-50);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--gray-700);
}

.link-btn-dark {
    display: block;
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

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

/* =========================================================================
   FORM ELEMENTS
   ========================================================================= */
.select-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 150px;
    font-family: inherit;
}

/* =========================================================================
   FOOTER SECTION
   ========================================================================= */
.footer-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* =========================================================================
   TEXT UTILITIES
   ========================================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.text-gray { color: var(--gray-500); }
.text-dark { color: var(--gray-900); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning-dark); }
.text-success { color: var(--success-dark); }
.text-white { color: var(--white); }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 15px; }
.text-xl { font-size: 16px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }
.text-4xl { font-size: 28px; }
.text-5xl { font-size: 32px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.font-mono { font-family: monospace; }

/* =========================================================================
   SPACING UTILITIES
   ========================================================================= */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-0 { margin-bottom: 0; }

.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* =========================================================================
   DISPLAY UTILITIES
   ========================================================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* =========================================================================
   RESPONSIVE - Desktop
   ========================================================================= */
@media (min-width: 640px) {
    .app-header {
        padding: 20px 24px;
    }
    .nav-blocks {
        padding: 24px;
    }
    .app-main {
        padding: 0 24px 48px;
    }
}
