/**
 * PlexManager - Material Design 3 Stylesheet
 * 
 * Mobile-first responsive design for PlexManager PWA.
 * Implements Material Design 3 color system, typography, and components.
 * 
 * Location: /assets/css/style.css
 */

/* =====================================================
   Material Design 3 Color System
   ===================================================== */
:root {
    /* Primary Color - Orange (#C2410C) */
    --md-color-primary: #C2410C;
    --md-color-on-primary: #FFFFFF;
    --md-color-primary-container: #F4DCC5;
    --md-color-on-primary-container: #411E00;
    
    /* Secondary Color - Slate Blue (#475569) */
    --md-color-secondary: #475569;
    --md-color-on-secondary: #FFFFFF;
    --md-color-secondary-container: #C9D0DD;
    --md-color-on-secondary-container: #031B2F;
    
    /* Tertiary Color - Teal (#06B6D4) */
    --md-color-tertiary: #06B6D4;
    --md-color-on-tertiary: #FFFFFF;
    --md-color-tertiary-container: #B2EBFC;
    --md-color-on-tertiary-container: #001D2B;
    
    /* Error Color - Red (#DC2626) */
    --md-color-error: #DC2626;
    --md-color-error-container: #F9DEDC;
    --md-color-on-error: #FFFFFF;
    --md-color-on-error-container: #410E0B;
    
    /* Neutral Colors */
    --md-color-background: #FFFBFE;
    --md-color-on-background: #1F2937;
    --md-color-surface: #FFFBFE;
    --md-color-on-surface: #1F2937;
    --md-color-surface-variant: #E7DCCD;
    --md-color-on-surface-variant: #64748B;
    
    /* Surface Tonal Colors */
    --md-color-surface-tonal-1: #FDF8F1;
    --md-color-surface-tonal-2: #F9F1E8;
    --md-color-surface-tonal-3: #F5EBE0;
    --md-color-surface-tonal-4: #F3E8DD;
    --md-color-surface-tonal-5: #F0E4D8;
    
    /* Outline Colors */
    --md-color-outline: #7E7566;
    --md-color-outline-variant: #C9D0DD;
    
    /* Scrim */
    --md-color-scrim: #000000;
    
    /* Legacy status colors (backward compatibility) */
    --status-active: #10b981;
    --status-expiring: #f59e0b;
    --status-overdue: #ef4444;
    --status-suspended: #8b5cf6;
    --status-voluntary-pause: #06b6d4;
    --status-inactive: #64748b;
    
    /* =====================================================
       Material Design 3 Elevation (Shadow System)
       ===================================================== */
    --md-elevation-0: none;
    --md-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --md-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --md-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --md-elevation-4: 0 5px 10px 4px rgba(0, 0, 0, 0.15), 0 2px 3px 0 rgba(0, 0, 0, 0.3);
    --md-elevation-5: 0 8px 16px 5px rgba(0, 0, 0, 0.15), 0 2px 4px 0 rgba(0, 0, 0, 0.3);
    
    /* =====================================================
       Material Design 3 Typography Scale
       ===================================================== */
    --md-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Display - Large, Medium, Small */
    --md-display-large: 57px / 64px 400;
    --md-display-medium: 45px / 52px 400;
    --md-display-small: 36px / 44px 400;
    
    /* Headline - Large, Medium, Small */
    --md-headline-large: 32px / 40px 400;
    --md-headline-medium: 28px / 36px 400;
    --md-headline-small: 24px / 32px 400;
    
    /* Title - Large, Medium, Small */
    --md-title-large: 22px / 28px 500;
    --md-title-medium: 16px / 24px 500;
    --md-title-small: 14px / 20px 500;
    
    /* Body - Large, Medium, Small */
    --md-body-large: 16px / 24px 400;
    --md-body-medium: 14px / 20px 400;
    --md-body-small: 12px / 16px 400;
    
    /* Label - Large, Medium, Small */
    --md-label-large: 14px / 20px 500;
    --md-label-medium: 12px / 16px 500;
    --md-label-small: 11px / 16px 500;
    
    /* Shape Tokens */
    --md-shape-corner-extra-small: 4px;
    --md-shape-corner-small: 8px;
    --md-shape-corner-medium: 12px;
    --md-shape-corner-large: 16px;
    --md-shape-corner-extra-large: 28px;
    
    /* Legacy font family */
    --font-family: var(--md-font-family);
    --border-radius: var(--md-shape-corner-large);
    
    /* Legacy shadows (map to elevation system) */
    --shadow-sm: var(--md-elevation-1);
    --shadow-md: var(--md-elevation-2);
    --shadow-lg: var(--md-elevation-3);
    --shadow-xl: var(--md-elevation-4);
    
    /* Legacy color references */
    --color-primary: var(--md-color-primary);
    --color-primary-dark: #9a3412;
    --color-secondary: var(--md-color-secondary);
    --color-success: #15803d;
    --color-warning: #f59e0b;
    --color-danger: var(--md-color-error);
    --color-info: var(--md-color-tertiary);
    --color-purple: #7c3aed;
    --color-gray: var(--md-color-on-surface-variant);
    --color-light: var(--md-color-surface);
    --color-dark: var(--md-color-on-background);
    --color-white: var(--md-color-on-primary);
    --color-border: var(--md-color-outline-variant);
    --color-bg: var(--md-color-background);
    
    --header-height: 64px;
    --nav-height: 64px;
}

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

body {
    font-family: var(--md-font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    background-color: var(--md-color-background);
    color: var(--md-color-on-background);
    -webkit-font-smoothing: antialiased;
    padding-bottom: var(--nav-height);
}

/* =====================================================
   Material Design 3 Typography Scale
   ===================================================== */
h1, .md-display-large {
    font-size: 57px;
    line-height: 64px;
    font-weight: 400;
    letter-spacing: -0.25px;
}

h2, .md-display-medium {
    font-size: 45px;
    line-height: 52px;
    font-weight: 400;
    letter-spacing: 0px;
}

h3, .md-display-small {
    font-size: 36px;
    line-height: 44px;
    font-weight: 400;
    letter-spacing: 0px;
}

h4, .md-headline-large {
    font-size: 32px;
    line-height: 40px;
    font-weight: 400;
    letter-spacing: 0px;
}

h5, .md-headline-medium {
    font-size: 28px;
    line-height: 36px;
    font-weight: 400;
    letter-spacing: 0px;
}

h6, .md-headline-small {
    font-size: 24px;
    line-height: 32px;
    font-weight: 400;
    letter-spacing: 0px;
}

.md-title-large {
    font-size: 22px;
    line-height: 28px;
    font-weight: 500;
    letter-spacing: 0px;
}

.md-title-medium {
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    letter-spacing: 0.15px;
}

.md-title-small {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.md-body-large {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.md-body-medium {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    letter-spacing: 0.25px;
}

.md-body-small {
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0.4px;
}

.md-label-large {
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.md-label-medium {
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.md-label-small {
    font-size: 11px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

a {
    color: var(--md-color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--md-color-primary);
}

/* =====================================================
   Header
   ===================================================== */
/* =====================================================
   Header Navigation (Material Design 3)
   ===================================================== */
.header {
    background: var(--md-primary);
    color: var(--md-on-primary);
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* MD3 Elevation 2dp */
    box-shadow: 0 2px 4px 0 rgba(31, 41, 55, 0.3), 0 3px 6px 1px rgba(31, 41, 55, 0.15);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--md-on-primary);
}

.header-brand:hover {
    opacity: 0.92;
    color: var(--md-on-primary);
}

.header-icon {
    font-size: 1.5rem;
}

.header h1 {
    font-size: var(--md-title-large);
    font-weight: 500;
    letter-spacing: 0;
}

.header-menu-toggle {
    display: none;
    background: var(--md-state-hover);
    border: none;
    color: var(--md-on-primary);
    font-size: 1.3rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-toggle:hover {
    background: var(--md-state-focus);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    color: var(--md-on-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: var(--md-state-hover);
    color: var(--md-on-primary);
}

.nav-link.active {
    background: var(--md-state-focus);
    color: var(--md-on-primary);
    font-weight: 600;
}

.nav-link svg {
    width: 1.2rem;
    height: 1.2rem;
}

.nav-link-logout {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.nav-link-logout:hover {
    background: rgba(220, 53, 69, 0.35);
}

.header-actions {
    display: none;
}

/* =====================================================
   Bottom Navigation (Mobile)
   ===================================================== */
/* =====================================================
   Bottom Navigation (Material Design 3)
   ===================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--md-surface);
    border-top: 1px solid var(--md-outline-variant);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    /* MD3 Elevation 3dp */
    box-shadow: 0 3px 6px 0 rgba(31, 41, 55, 0.2), 0 6px 12px 1px rgba(31, 41, 55, 0.1);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--md-on-surface-variant);
    font-size: 0.7rem;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    flex: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    position: relative;
}

.bottom-nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-primary);
    opacity: 0;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.bottom-nav a:hover {
    color: var(--md-on-surface);
}

.bottom-nav a:hover::before {
    opacity: 0.04;
}

.bottom-nav a.active {
    color: var(--md-primary);
    font-weight: 500;
}

.bottom-nav a.active::before {
    opacity: 0.08;
}

.bottom-nav a svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* =====================================================
   Main Container
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* =====================================================
   Cards
   ===================================================== */
/* =====================================================
   Cards (Material Design 3)
   ===================================================== */
.card {
    background: var(--md-surface);
    color: var(--md-on-surface);
    border-radius: 12px;
    /* MD3 Elevation 1 (1dp) */
    box-shadow: 0 1px 2px 0 rgba(31, 41, 55, 0.3), 0 1px 3px 1px rgba(31, 41, 55, 0.15);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card::before {
    /* MD3 State Layer for hover effect */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-state-hover);
    opacity: 0;
    border-radius: 12px;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.card:hover {
    /* MD3 Elevation 2 (2dp) on hover */
    box-shadow: 0 2px 4px 0 rgba(31, 41, 55, 0.3), 0 3px 6px 1px rgba(31, 41, 55, 0.15);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--md-outline);
}

.card-header h2 {
    font-size: var(--md-title-large);
    font-weight: 500;
    color: var(--md-on-surface);
}

.card-body {
    padding: 0;
}

/* =====================================================
   Dashboard Stats Cards (Material Design 3)
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--md-surface-dim);
    border-radius: 12px;
    /* MD3 Elevation 0dp - subtle surface */
    padding: 1rem;
    box-shadow: 0 1px 2px 0 rgba(31, 41, 55, 0.2);
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--md-on-surface);
}

.stat-card:hover {
    background: var(--md-surface);
    box-shadow: 0 2px 4px 0 rgba(31, 41, 55, 0.3), 0 3px 6px 1px rgba(31, 41, 55, 0.15);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--md-on-surface-variant);
    margin-top: 0.25rem;
}

.stat-card.active .stat-number { color: var(--status-active); }
.stat-card.expiring .stat-number { color: var(--status-expiring); }
.stat-card.overdue .stat-number { color: var(--status-overdue); }
.stat-card.suspended .stat-number { color: var(--status-suspended); }
.stat-card.paused .stat-number { color: var(--status-voluntary-pause); }

/* =====================================================
   Status Badges (Material Design 3)
   ===================================================== */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-white);
    transition: all 0.2s ease;
}

.status-active { 
    background-color: var(--status-active);
    box-shadow: 0 1px 2px rgba(46, 125, 50, 0.3);
}

.status-expiring { 
    background-color: var(--status-expiring);
    box-shadow: 0 1px 2px rgba(230, 124, 115, 0.3);
}

.status-overdue { 
    background-color: var(--status-overdue);
    box-shadow: 0 1px 2px rgba(211, 47, 47, 0.3);
}

.status-suspended { 
    background-color: var(--status-suspended);
    box-shadow: 0 1px 2px rgba(211, 47, 47, 0.3);
}

.status-voluntary-pause { 
    background-color: var(--status-voluntary-pause);
    box-shadow: 0 1px 2px rgba(251, 192, 45, 0.3);
}

.status-inactive { 
    background-color: var(--status-inactive);
    box-shadow: 0 1px 2px rgba(158, 158, 158, 0.3);
}

/* =====================================================
   Tables
   ===================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

table th {
    background: var(--color-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: rgba(229, 160, 13, 0.05);
}

table tr {
    cursor: pointer;
}

/* =====================================================
   Forms
   ===================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label .required {
    color: var(--color-danger);
}

/* =====================================================
   Form Controls (Material Design 3)
   ===================================================== */
.form-control {
    width: 100%;
    padding: 0.75rem 0;
    border: none;
    border-bottom: 1px solid var(--md-outline);
    border-radius: 4px 4px 0 0;
    font-size: 1rem;
    font-family: inherit;
    color: var(--md-on-surface);
    background: var(--md-surface-dim);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    outline: none;
    border-bottom-color: var(--md-primary);
    border-bottom-width: 2px;
    background: var(--md-surface);
    box-shadow: inset 0 -2px 0 0 var(--md-primary);
    padding: 0.75rem 0;
}

.form-control:disabled {
    background: var(--md-surface-dim);
    color: var(--md-on-surface);
    opacity: 0.38;
    cursor: not-allowed;
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

.form-control::placeholder {
    color: var(--md-on-surface-variant);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236f42c1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1.75rem;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
    border-radius: 4px ;
    padding: 0.75rem;
    border-bottom-width: 1px;
}

.form-text {
    font-size: 0.75rem;
    color: var(--md-on-surface-variant);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--md-on-surface);
}

.text-info {
    color: var(--md-info);
}

/* =====================================================
   Buttons
   ===================================================== */
/* =====================================================
   Material Design 3 Buttons
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--md-shape-corner-large);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--md-color-scrim);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::before {
    opacity: 0.08;
}

.btn:active::before {
    opacity: 0.12;
}

.btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.btn:disabled:hover::before {
    opacity: 0;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Filled Button (Primary) */
.btn-primary {
    background: var(--md-color-primary);
    color: var(--md-color-on-primary);
    box-shadow: var(--md-elevation-0);
}

.btn-primary:hover:not(:disabled) {
    background: var(--md-color-primary);
    box-shadow: var(--md-elevation-1);
}

.btn-primary:active:not(:disabled) {
    box-shadow: var(--md-elevation-1);
}

/* Tonal Button (Secondary) */
.btn-secondary {
    background: var(--md-color-secondary-container);
    color: var(--md-color-on-secondary-container);
    box-shadow: var(--md-elevation-0);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--md-color-secondary-container);
    box-shadow: var(--md-elevation-1);
}

/* Tonal Button (Success) */
.btn-success {
    background: #C8E6C9;
    color: #1B5E20;
    box-shadow: var(--md-elevation-0);
}

.btn-success:hover:not(:disabled) {
    background: #C8E6C9;
    box-shadow: var(--md-elevation-1);
}

/* Tonal Button (Danger/Error) */
.btn-danger {
    background: var(--md-color-error-container);
    color: var(--md-color-on-error-container);
    box-shadow: var(--md-elevation-0);
}

.btn-danger:hover:not(:disabled) {
    background: var(--md-color-error-container);
    box-shadow: var(--md-elevation-1);
}

/* Tonal Button (Warning) */
.btn-warning {
    background: #FFF3E0;
    color: #E65100;
    box-shadow: var(--md-elevation-0);
}

.btn-warning:hover:not(:disabled) {
    background: #FFF3E0;
    box-shadow: var(--md-elevation-1);
}

/* Text Button (Info) */
.btn-info {
    background: transparent;
    color: var(--md-color-tertiary);
}

.btn-info:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.08);
}

/* Outlined Button */
.btn-outline {
    background: transparent;
    border: 1px solid var(--md-color-outline);
    color: var(--md-color-on-background);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(31, 41, 55, 0.05);
    box-shadow: var(--md-elevation-1);
}

/* =====================================================
   Alerts & Flash Messages (Material Design 3)
   ===================================================== */
.alert {
    padding: 0.75rem 1rem 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(46, 125, 50, 0.08);
    color: rgba(0, 0, 0, 0.87);
    border-left-color: #2e7d32;
}

.alert-danger {
    background: rgba(211, 47, 47, 0.08);
    color: rgba(0, 0, 0, 0.87);
    border-left-color: #d32f2f;
}

.alert-warning {
    background: rgba(251, 192, 45, 0.08);
    color: rgba(0, 0, 0, 0.87);
    border-left-color: #fbc02d;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

/* =====================================================
   Plans Grid Layout
   ===================================================== */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

/* Plan Cards (Material Design 3) */
.plan-card {
    padding: 1.75rem 2rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    /* MD3 Elevation 1dp for plan cards */
    box-shadow: 0 1px 2px 0 rgba(31, 41, 55, 0.3), 0 1px 3px 1px rgba(31, 41, 55, 0.15) !important;
}

.plan-card:hover {
    /* MD3 Elevation 2dp on hover */
    box-shadow: 0 2px 4px 0 rgba(31, 41, 55, 0.3), 0 3px 6px 1px rgba(31, 41, 55, 0.15) !important;
}

.plan-card .client-info {
    margin-bottom: 1.25rem;
}

.plan-card .client-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: auto;
}

/* =====================================================
   Client List Item (Mobile Optimized)
   ===================================================== */
.client-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--md-surface);
    color: var(--md-on-surface);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    /* MD3 Elevation 0dp */
    box-shadow: 0 1px 2px 0 rgba(31, 41, 55, 0.2);
    gap: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.client-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-state-hover);
    opacity: 0;
    border-radius: 12px;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.client-list-item:hover {
    /* MD3 Elevation 1dp on hover */
    box-shadow: 0 2px 4px 0 rgba(31, 41, 55, 0.3), 0 3px 6px 1px rgba(31, 41, 55, 0.15);
}

.client-list-item:hover::before {
    opacity: 1;
}

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

.client-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.client-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.client-note,
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--color-gray);
    background: rgba(15, 23, 42, 0.05);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.client-note {
    color: var(--color-dark);
    background: rgba(249, 250, 251, 0.95);
}

.client-note-special {
    background: rgba(56, 189, 248, 0.12);
    color: var(--color-info);
}

.client-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.meta-chip-plan {
    background: rgba(252, 211, 77, 0.16);
    color: #92400e;
}

.meta-chip-price {
    background: rgba(16, 185, 129, 0.14);
    color: var(--status-active);
}

.meta-chip-expiry {
    background: rgba(14, 165, 233, 0.12);
    color: var(--color-info);
}

.meta-chip svg,
.client-note svg {
    width: 1rem;
    height: 1rem;
}

.client-expiry {
    font-size: 0.95rem;
    color: var(--color-dark);
    font-weight: 600;
}

.expiry-label {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-gray);
    margin-right: 0.35rem;
    font-weight: 500;
}

.expiry-overdue {
    color: var(--color-danger);
}

.client-actions {
    display: grid;
    gap: 0.5rem;
    align-items: start;
    justify-content: end;
}

.btn-icon-square {
    width: 2.6rem;
    height: 2.6rem;
    min-width: 2.6rem;
    padding: 0;
    border-radius: 14px;
    justify-content: center;
}

.btn-icon-square svg {
    width: 1rem;
    height: 1rem;
}

.btn-icon-square.btn-outline {
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.88);
    color: var(--color-dark);
}

.btn-icon-square.btn-outline:hover {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: var(--shadow-sm);
}

/* =====================================================
   Client Actions - Button Style Override
   ===================================================== */
.client-actions .action-btn {
    background: #e5e7eb !important;
    color: #4b5563 !important;
    border: none !important;
    transition: all 0.25s ease !important;
}

.client-actions .action-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    color: var(--color-white) !important;
}

/* Specific colors on hover */
.client-actions .action-payment:hover {
    background: var(--color-success) !important;
}

.client-actions .action-toggle:hover {
    background: var(--color-warning) !important;
}

.client-actions .action-notify:hover {
    background: #6b7280 !important;
}

.client-actions .action-whatsapp:hover {
    background: #25d366 !important;
}

.client-actions .action-detail:hover {
    background: #5a6b7a !important;
}

/* =====================================================
   Filter Bar
   ===================================================== */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
    height: 4px;
}

.filter-bar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-white);
    color: var(--color-dark);
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* =====================================================
   Search Bar
   ===================================================== */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: 25px;
    font-size: 1rem;
}

.search-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray);
    width: 1.2rem;
    height: 1.2rem;
}

/* =====================================================
   Dashboard Alerts
   ===================================================== */
.dashboard-alert {
    background: var(--color-white);
    border-left: 4px solid var(--color-warning);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--shadow-sm);
}

.dashboard-alert.danger {
    border-left-color: var(--color-danger);
}

.dashboard-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dashboard-alert-text {
    font-size: 0.9rem;
    color: var(--color-gray);
}

/* =====================================================
   Sessions List
   ===================================================== */
.session-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

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

.session-user {
    flex: 1;
}

.session-user strong {
    display: block;
}

.session-user small {
    color: var(--color-gray);
}

.session-device {
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* =====================================================
   Modal
   ===================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--md-surface);
    color: var(--md-on-surface);
    border-radius: 28px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    /* MD3 Elevation 3dp (prominent surface) */
    box-shadow: 0 3px 6px 0 rgba(31, 41, 55, 0.3), 0 6px 12px 1px rgba(31, 41, 55, 0.15);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--md-outline);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: var(--md-headline-medium);
    font-weight: 500;
    color: var(--md-on-surface);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--md-outline);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* =====================================================
   Detail Page Header
   ===================================================== */
.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-header .back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.detail-title {
    flex: 1;
}

.detail-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.detail-title p {
    color: var(--color-gray);
    font-size: 0.9rem;
}

/* =====================================================
   Tabs
   ===================================================== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1rem;
    color: var(--color-gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover,
.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* =====================================================
   Financial Metrics
   ===================================================== */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.financial-card {
    background: var(--color-white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.financial-card .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.financial-card .label {
    font-size: 0.8rem;
    color: var(--color-gray);
}

.financial-card.highlight .amount {
    color: var(--color-success);
}

.financial-card.warning .amount {
    color: var(--color-danger);
}

/* =====================================================
   Chart Container
   ===================================================== */
.chart-container {
    background: var(--color-white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 200px;
    padding: 1rem 0;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-bar-item .bar {
    width: 100%;
    background: var(--color-primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.chart-bar-item .bar.expected {
    background: var(--color-gray);
}

.chart-bar-item .label {
    font-size: 0.7rem;
    color: var(--color-gray);
    margin-top: 0.5rem;
    text-align: center;
}

/* =====================================================
   Login Page
   ===================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #1a1a1a 100%);
    padding: 1rem;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--color-gray);
    margin-bottom: 2rem;
}

/* =====================================================
   Responsive - Tablet & Desktop
   ===================================================== */
/* =====================================================
   Mobile Responsive (max-width: 767px)
   ===================================================== */
@media (max-width: 767px) {
    .header h1 {
        font-size: 1rem;
    }

    .header-menu-toggle {
        display: block;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-primary);
        flex-direction: column;
        padding: 0.75rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1001;
    }

    .header-nav.open {
        display: flex;
    }

    .header-nav .nav-link {
        padding: 0.75rem 1rem;
        width: 100%;
        text-align: left;
        border-radius: 4px;
    }

    .header {
        height: auto;
        min-height: var(--header-height);
    }

    .bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: var(--nav-height);
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        text-align: center;
    }

    .client-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .client-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .search-bar input {
        font-size: 0.9rem;
        padding: 0.65rem 1rem 0.65rem 2.25rem;
    }
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .financial-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body {
        padding-bottom: 0;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .sidebar {
        display: block;
    }
}

@media (min-width: 992px) {
    .container {
        padding: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .header,
    .bottom-nav,
    .btn,
    .filter-bar,
    .search-bar {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        max-width: 100%;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-gray); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }
.visible { display: block; }
