/* DoctorCare Admin Portal - Custom Theme */
:root {
    --dc-primary: #0891b2;
    --dc-primary-dark: #0e7490;
    --dc-primary-light: #06b6d4;
    --dc-secondary: #64748b;
    --dc-success: #10b981;
    --dc-warning: #f59e0b;
    --dc-danger: #ef4444;
    --dc-info: #3b82f6;
    --dc-dark: #1e293b;
    --dc-darker: #0f172a;
    --dc-light: #f1f5f9;
    --dc-white: #ffffff;
    --dc-border: #e2e8f0;
    --dc-text: #334155;
    --dc-text-muted: #94a3b8;
    --dc-sidebar-width: 280px;
    --dc-header-height: 64px;
    --dc-gradient: linear-gradient(135deg, var(--dc-primary) 0%, var(--dc-primary-dark) 100%);
    --dc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --dc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--dc-light);
    color: var(--dc-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--dc-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Links */
a, .btn-link {
    color: var(--dc-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--dc-primary-dark);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--dc-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--dc-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--dc-shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--dc-primary);
    color: var(--dc-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--dc-primary);
    color: white;
}

.btn-success {
    background: var(--dc-success);
    border: none;
    color: white;
}

.btn-danger {
    background: var(--dc-danger);
    border: none;
    color: white;
}

/* Cards */
.card {
    background: var(--dc-white);
    border: 1px solid var(--dc-border);
    border-radius: 1rem;
    box-shadow: var(--dc-shadow);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--dc-shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--dc-border);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: 1rem;
    color: white;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-30deg);
}

.stat-card.primary { background: var(--dc-gradient); }
.stat-card.success { background: linear-gradient(135deg, var(--dc-success) 0%, #059669 100%); }
.stat-card.warning { background: linear-gradient(135deg, var(--dc-warning) 0%, #d97706 100%); }
.stat-card.info { background: linear-gradient(135deg, var(--dc-info) 0%, #2563eb 100%); }

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables */
.table {
    background: var(--dc-white);
    border-radius: 0.75rem;
    overflow: hidden;
}

.table thead {
    background: var(--dc-dark);
    color: white;
}

.table thead th {
    font-weight: 600;
    padding: 1rem;
    border: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--dc-border);
}

.table-hover tbody tr:hover {
    background: var(--dc-light);
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge.bg-success { background: var(--dc-success) !important; }
.badge.bg-warning { background: var(--dc-warning) !important; }
.badge.bg-danger { background: var(--dc-danger) !important; }
.badge.bg-info { background: var(--dc-info) !important; }
.badge.bg-primary { background: var(--dc-primary) !important; }
.badge.bg-secondary { background: var(--dc-secondary) !important; }

/* Forms */
.form-control, .form-select {
    border: 2px solid var(--dc-border);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--dc-dark);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--dc-info);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dc-success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--dc-danger);
}

/* Spinners */
.spinner-border {
    color: var(--dc-primary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dc-border);
}

.page-header h1 {
    margin: 0;
}

/* Content wrapper */
.content {
    padding: 1.5rem;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--dc-success);
}

.invalid {
    border-color: var(--dc-danger);
}

.validation-message {
    color: var(--dc-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Error Boundary */
.blazor-error-boundary {
    background: var(--dc-danger);
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    background: #fef3c7;
    border-top: 3px solid var(--dc-warning);
    bottom: 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #92400e;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}

/* Wizard Steps */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--dc-border);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dc-white);
    border: 3px solid var(--dc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.wizard-step.active .wizard-step-number {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.wizard-step.completed .wizard-step-number {
    background: var(--dc-success);
    border-color: var(--dc-success);
    color: white;
}

.wizard-step-title {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wizard-step.active .wizard-step-title,
.wizard-step.completed .wizard-step-title {
    color: var(--dc-dark);
    font-weight: 500;
}

/* Quick Action Cards */
.quick-action {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: var(--dc-white);
    border: 1px solid var(--dc-border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--dc-text);
    transition: all 0.2s ease;
}

.quick-action:hover {
    border-color: var(--dc-primary);
    box-shadow: var(--dc-shadow-lg);
    transform: translateY(-2px);
    color: var(--dc-text);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.quick-action-icon.primary { background: rgba(8, 145, 178, 0.1); color: var(--dc-primary); }
.quick-action-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--dc-success); }
.quick-action-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--dc-warning); }
.quick-action-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--dc-info); }

.quick-action-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.quick-action-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--dc-text-muted);
}

/* Activity List */
.activity-item {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid var(--dc-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.activity-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--dc-success); }
.activity-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--dc-warning); }
.activity-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--dc-info); }

.activity-content {
    flex: 1;
}

.activity-content strong {
    color: var(--dc-dark);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .wizard-step-title {
        display: none;
    }
}

/* ========================================
   PUBLIC LAYOUT STYLES
   ======================================== */

.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-header {
    background: var(--dc-white);
    border-bottom: 1px solid var(--dc-border);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--dc-dark);
}

.logo-link .logo-icon {
    color: var(--dc-primary);
}

.logo-link .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-nav .nav-link {
    padding: 0.5rem 1rem;
    color: var(--dc-text);
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.header-nav .nav-link:hover {
    background: var(--dc-light);
    color: var(--dc-primary);
}

.header-nav .nav-link-admin {
    background: var(--dc-dark);
    color: white;
}

.header-nav .nav-link-admin:hover {
    background: var(--dc-darker);
    color: white;
}

.public-main {
    flex: 1;
}

.public-footer {
    background: var(--dc-darker);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dc-primary-light);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-tagline {
    color: var(--dc-text-muted);
    line-height: 1.6;
}

.footer-links h4 {
    color: white;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.footer-links a {
    display: block;
    color: var(--dc-text-muted);
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--dc-primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .header-nav {
        gap: 0.5rem;
    }

    .header-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

.login-page {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--dc-light) 0%, #e0f2fe 100%);
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--dc-white);
    border-radius: 1.5rem;
    box-shadow: var(--dc-shadow-lg);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--dc-gradient);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--dc-text-muted);
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dc-dark);
}

.login-form .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
}

.login-form .input-icon-wrapper {
    position: relative;
}

.login-form .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dc-text-muted);
}

.login-form .input-icon-wrapper .form-control {
    padding-left: 3rem;
}

.login-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-form .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-password {
    color: var(--dc-primary);
    font-size: 0.875rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dc-border);
}

.login-footer p {
    color: var(--dc-text-muted);
    margin: 0;
}

.login-footer a {
    font-weight: 500;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--dc-danger);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--dc-danger);
    font-size: 0.875rem;
}

.login-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--dc-success);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--dc-success);
    font-size: 0.875rem;
}

/* ========================================
   LANDING PAGE STYLES
   ======================================== */

.landing-hero {
    background: linear-gradient(135deg, var(--dc-darker) 0%, var(--dc-dark) 100%);
    color: white;
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230891b2' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(8, 145, 178, 0.2);
    color: var(--dc-primary-light);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
}

.hero-title span {
    color: var(--dc-primary-light);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.hero-btn-primary {
    background: var(--dc-gradient);
    color: white;
    border: none;
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(8, 145, 178, 0.3);
}

.hero-btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-btn-outline:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.features-section {
    padding: 6rem 2rem;
    background: var(--dc-white);
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--dc-text-muted);
    font-size: 1.125rem;
    max-width: 640px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--dc-border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--dc-primary);
    box-shadow: var(--dc-shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.feature-icon.primary { background: rgba(8, 145, 178, 0.1); color: var(--dc-primary); }
.feature-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--dc-success); }
.feature-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--dc-warning); }
.feature-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--dc-info); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.feature-icon.pink { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--dc-text-muted);
    line-height: 1.6;
    margin: 0;
}

.pricing-section {
    padding: 6rem 2rem;
    background: var(--dc-light);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.pricing-card {
    background: var(--dc-white);
    border-radius: 1.25rem;
    padding: 2rem;
    border: 2px solid var(--dc-border);
    transition: all 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    border-color: var(--dc-primary);
    box-shadow: var(--dc-shadow-lg);
}

.pricing-card.popular {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dc-gradient);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
    margin-bottom: 1.5rem;
}

.pricing-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.pricing-header p {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.pricing-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pricing-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dc-dark);
}

.pricing-currency {
    font-size: 1.25rem;
    color: var(--dc-text-muted);
    vertical-align: super;
}

.pricing-period {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.pricing-features li svg {
    color: var(--dc-success);
    flex-shrink: 0;
}

.pricing-btn {
    width: 100%;
    padding: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .pricing-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ========================================
   CUSTOMER PORTAL LAYOUT STYLES
   ======================================== */

.customer-layout {
    min-height: 100vh;
    display: flex;
    background: var(--dc-light);
}

.customer-sidebar {
    width: 280px;
    background: var(--dc-white);
    border-right: 1px solid var(--dc-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.customer-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.customer-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dc-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.customer-practice-info {
    background: var(--dc-light);
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.customer-practice-name {
    font-weight: 600;
    color: var(--dc-dark);
    font-size: 0.875rem;
}

.customer-practice-type {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.customer-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.customer-nav-section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.customer-nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dc-text-muted);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.customer-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--dc-text);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    font-weight: 500;
}

.customer-nav-link:hover {
    background: var(--dc-light);
    color: var(--dc-primary);
}

.customer-nav-link.active {
    background: rgba(8, 145, 178, 0.1);
    color: var(--dc-primary);
}

.customer-nav-link svg {
    width: 20px;
    height: 20px;
}

.customer-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--dc-border);
}

.customer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--dc-border);
    border-radius: 0.5rem;
    color: var(--dc-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-logout-btn:hover {
    background: var(--dc-danger);
    border-color: var(--dc-danger);
    color: white;
}

.customer-main {
    flex: 1;
    margin-left: 280px;
}

.customer-header {
    background: var(--dc-white);
    border-bottom: 1px solid var(--dc-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.customer-page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0;
}

.customer-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--dc-light);
}

.customer-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.customer-user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.customer-content {
    padding: 2rem;
}

@media (max-width: 768px) {
    .customer-sidebar {
        transform: translateX(-100%);
    }

    .customer-main {
        margin-left: 0;
    }
}

/* ===================================
   Registration Wizard Styles
   =================================== */

.register-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dc-light) 0%, #e2e8f0 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-container {
    width: 100%;
    max-width: 800px;
}

.register-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dc-border);
    color: var(--dc-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--dc-primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--dc-success);
    color: white;
}

.progress-step .step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    text-align: center;
    white-space: nowrap;
}

.progress-step.active .step-label {
    color: var(--dc-primary);
    font-weight: 500;
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--dc-border);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s ease;
}

.progress-line.active {
    background: var(--dc-success);
}

.register-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--dc-shadow-lg);
}

.register-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--dc-danger);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.register-step h2 {
    margin-bottom: 0.5rem;
    color: var(--dc-dark);
}

.step-description {
    color: var(--dc-text-muted);
    margin-bottom: 2rem;
}

.register-form .form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.register-form .form-row.two-col {
    grid-template-columns: 1fr 1fr;
}

.register-form .form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.register-form .form-group {
    display: flex;
    flex-direction: column;
}

.register-form .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark);
    margin-bottom: 0.5rem;
}

.register-form .form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--dc-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.register-form .form-control:focus {
    outline: none;
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.register-form .form-hint {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-top: 0.25rem;
}

.register-form .checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}

.register-form .checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
}

/* Plan Selector */
.plan-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.plan-option {
    border: 2px solid var(--dc-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.plan-option:hover {
    border-color: var(--dc-primary-light);
}

.plan-option.selected {
    border-color: var(--dc-primary);
    background: rgba(8, 145, 178, 0.05);
}

.plan-option.popular {
    border-color: var(--dc-primary);
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dc-primary);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.plan-option h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.plan-option .plan-description {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-bottom: 0.75rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.plan-price .currency {
    font-size: 1rem;
    font-weight: 500;
}

.plan-price .amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.plan-price .period {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-left: 0.25rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.plan-features li {
    margin-bottom: 0.25rem;
}

.plan-select-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: var(--dc-primary);
}

/* Billing Cycle Selector */
.billing-cycle-selector {
    margin-bottom: 2rem;
}

.billing-cycle-selector h4 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.cycle-options {
    display: flex;
    gap: 0.5rem;
}

.cycle-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--dc-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cycle-option:hover {
    border-color: var(--dc-primary-light);
}

.cycle-option.selected {
    border-color: var(--dc-primary);
    background: rgba(8, 145, 178, 0.05);
}

.cycle-option input {
    display: none;
}

.cycle-label {
    font-weight: 500;
}

.cycle-discount {
    font-size: 0.625rem;
    background: var(--dc-success);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
}

/* User Count Selector */
.user-count-selector {
    margin-bottom: 2rem;
}

.user-count-selector h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.selector-description {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-bottom: 0.75rem;
}

.user-count-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.count-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--dc-border);
    border-radius: 0.5rem;
    background: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-btn:hover:not(:disabled) {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.count-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.count-value {
    font-size: 2rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

/* Price Summary */
.price-summary {
    background: var(--dc-light);
    border-radius: 0.5rem;
    padding: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.summary-row.discount {
    color: var(--dc-success);
}

.summary-row.total {
    border-top: 1px solid var(--dc-border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Password Requirements */
.password-requirements {
    background: var(--dc-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.password-requirements p {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dc-dark);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.password-requirements li {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    padding-left: 1.25rem;
    position: relative;
}

.password-requirements li::before {
    content: '○';
    position: absolute;
    left: 0;
}

.password-requirements li.valid {
    color: var(--dc-success);
}

.password-requirements li.valid::before {
    content: '●';
}

/* Confirmation Step */
.register-step.confirmation {
    text-align: center;
}

.confirmation-icon {
    color: var(--dc-success);
    margin-bottom: 1rem;
}

.confirmation-details {
    display: grid;
    gap: 1.5rem;
    text-align: left;
    margin: 2rem 0;
}

.detail-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dc-text-muted);
    margin-bottom: 0.5rem;
}

.detail-section p {
    margin: 0.25rem 0;
    color: var(--dc-text);
}

.price-highlight {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-primary) !important;
}

.trial-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(8, 145, 178, 0.1);
    border: 1px solid rgba(8, 145, 178, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--dc-primary-dark);
}

.trial-notice svg {
    flex-shrink: 0;
}

.trial-notice p {
    margin: 0;
    font-size: 0.875rem;
}

/* Navigation Buttons */
.register-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dc-border);
}

/* ===================================
   Registration Success Styles
   =================================== */

.success-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dc-light) 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.success-container {
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: var(--dc-shadow-lg);
}

.success-icon {
    color: var(--dc-success);
    margin-bottom: 1.5rem;
}

.success-container h1 {
    margin-bottom: 1rem;
}

.success-message {
    color: var(--dc-text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.next-steps {
    text-align: left;
    margin-bottom: 2rem;
}

.next-steps h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.step-content p {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin: 0;
}

.trial-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(8, 145, 178, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    color: var(--dc-primary-dark);
    font-size: 0.875rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.download-section {
    padding-top: 2rem;
    border-top: 1px solid var(--dc-border);
}

.download-section h4 {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--dc-dark);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--dc-darker);
    color: white;
    transform: translateY(-2px);
}

.download-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

/* ===================================
   Pricing Page Styles
   =================================== */

.pricing-page {
    background: var(--dc-light);
}

.pricing-hero {
    background: linear-gradient(135deg, var(--dc-dark) 0%, var(--dc-darker) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.pricing-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.billing-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    color: white;
}

.toggle-btn.active {
    background: white;
    color: var(--dc-dark);
}

.save-badge {
    font-size: 0.625rem;
    background: var(--dc-success);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.pricing-cards {
    padding: 4rem 2rem;
    margin-top: -2rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--dc-shadow);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dc-shadow-lg);
}

.pricing-card.popular {
    border: 2px solid var(--dc-primary);
    transform: scale(1.05);
}

.pricing-card.popular:hover {
    transform: scale(1.05) translateY(-4px);
}

.popular-ribbon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dc-primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tier-description {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.card-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.card-price .currency {
    font-size: 1.25rem;
    font-weight: 500;
}

.card-price .amount {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.card-price .period {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    margin-left: 0.25rem;
}

.price-note {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-bottom: 1rem;
}

.card-users {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.user-range {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-label {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--dc-text);
}

.feature-list svg {
    color: var(--dc-success);
    flex-shrink: 0;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Feature Comparison */
.feature-comparison {
    padding: 4rem 2rem;
    background: white;
}

.feature-comparison h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.comparison-table-wrapper {
    overflow-x: auto;
    max-width: 1200px;
    margin: 0 auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--dc-border);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.comparison-table thead th {
    background: var(--dc-light);
    font-weight: 600;
}

.comparison-table th.popular {
    background: rgba(8, 145, 178, 0.1);
    color: var(--dc-primary);
}

.comparison-table .check {
    color: var(--dc-success);
    font-size: 1.25rem;
}

.comparison-table .dash {
    color: var(--dc-text-muted);
}

/* FAQ Section */
.pricing-faq {
    padding: 4rem 2rem;
}

.pricing-faq h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
}

.faq-item h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--dc-dark);
}

.faq-item p {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Pricing CTA */
.pricing-cta {
    background: linear-gradient(135deg, var(--dc-primary) 0%, var(--dc-primary-dark) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.pricing-cta h2 {
    color: white;
    margin-bottom: 1rem;
}

.pricing-cta p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.pricing-cta .btn-outline-primary {
    border-color: white;
    color: white;
}

.pricing-cta .btn-outline-primary:hover {
    background: white;
    color: var(--dc-primary);
}

/* ===================================
   Auth Error/Success Messages
   =================================== */

.error-message-box {
    text-align: center;
    padding: 2rem;
}

.error-icon {
    color: var(--dc-danger);
    margin-bottom: 1rem;
}

.error-message-box h3 {
    margin-bottom: 0.5rem;
}

.error-message-box p {
    color: var(--dc-text-muted);
    margin-bottom: 1.5rem;
}

.hint {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .register-form .form-row.two-col,
    .register-form .form-row.three-col {
        grid-template-columns: 1fr;
    }

    .plan-selector {
        grid-template-columns: 1fr;
    }

    .cycle-options {
        flex-direction: column;
    }

    .billing-toggle {
        flex-direction: column;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card.popular {
        transform: none;
    }

    .pricing-card.popular:hover {
        transform: translateY(-4px);
    }

    .success-actions {
        flex-direction: column;
    }

    .password-requirements ul {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* ===================================
   Customer Portal Dashboard Styles
   =================================== */

.portal-dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Welcome Section */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--dc-primary) 0%, var(--dc-primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.welcome-content h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.welcome-content p {
    opacity: 0.9;
    margin: 0;
}

.welcome-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.welcome-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--dc-shadow);
    border-left: 4px solid var(--dc-border);
}

.stat-card.status-active {
    border-left-color: var(--dc-success);
}

.stat-card.status-trial {
    border-left-color: var(--dc-info);
}

.stat-card.status-warning {
    border-left-color: var(--dc-warning);
}

.stat-card.status-danger {
    border-left-color: var(--dc-danger);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: var(--dc-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-primary);
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
    margin: 0;
}

.stat-meta {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.dashboard-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--dc-shadow);
    overflow: hidden;
}

.dashboard-card.license-overview,
.dashboard-card.recent-invoices {
    grid-column: span 1;
}

.dashboard-card.quick-actions,
.dashboard-card.practice-info {
    grid-column: span 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.card-header h2 {
    font-size: 1rem;
    margin: 0;
}

.card-action {
    font-size: 0.875rem;
    color: var(--dc-primary);
    background: none;
    border: none;
    cursor: pointer;
}

.card-action:hover {
    text-decoration: underline;
}

.card-content {
    padding: 1.5rem;
}

/* License Overview */
.license-info {
    margin-bottom: 1rem;
}

.license-tier {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tier-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.solo {
    background: #e2e8f0;
    color: #475569;
}

.tier-badge.standard {
    background: rgba(8, 145, 178, 0.1);
    color: var(--dc-primary);
}

.tier-badge.professional {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.tier-badge.enterprise {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.tier-description {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

.license-features h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dc-text-muted);
    margin-bottom: 0.75rem;
}

.license-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.license-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.license-features svg {
    color: var(--dc-success);
    flex-shrink: 0;
}

.trial-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    color: #1e40af;
    font-size: 0.875rem;
}

.trial-banner svg {
    flex-shrink: 0;
}

.trial-banner a {
    color: inherit;
    font-weight: 500;
}

/* Quick Actions */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.action-item:hover {
    background: var(--dc-light);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon.upgrade {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dc-success);
}

.action-icon.users {
    background: rgba(59, 130, 246, 0.1);
    color: var(--dc-info);
}

.action-icon.billing {
    background: rgba(245, 158, 11, 0.1);
    color: var(--dc-warning);
}

.action-icon.download {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.action-content h4 {
    font-size: 0.875rem;
    margin: 0 0 0.125rem 0;
}

.action-content p {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin: 0;
}

/* Invoice Table */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--dc-border);
}

.invoice-table th {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dc-success);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--dc-warning);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--dc-danger);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--dc-text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    color: var(--dc-text);
}

.empty-state span {
    font-size: 0.875rem;
}

/* Practice Info */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item.full-width {
    grid-column: span 2;
}

.info-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 0.875rem;
    color: var(--dc-dark);
}

.info-item span.code {
    font-family: monospace;
    background: var(--dc-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card.license-overview,
    .dashboard-card.quick-actions,
    .dashboard-card.recent-invoices,
    .dashboard-card.practice-info {
        grid-column: span 1;
    }

    .license-features ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item.full-width {
        grid-column: span 1;
    }
}

/* ===================================
   Subscription Page Styles
   =================================== */

.subscription-page,
.billing-page {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.section-header p {
    margin: 0;
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.trial {
    background: rgba(59, 130, 246, 0.1);
    color: var(--dc-info);
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dc-success);
}

.status-badge.past-due {
    background: rgba(245, 158, 11, 0.1);
    color: var(--dc-warning);
}

.status-badge.canceled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--dc-danger);
}

/* Current Subscription Card */
.current-subscription {
    margin-bottom: 3rem;
}

.subscription-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.plan-info {
    flex: 1;
}

.plan-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.plan-header .plan-description {
    color: var(--dc-text-muted);
    margin: 0 0 1.5rem 0;
}

.plan-details {
    display: flex;
    gap: 2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.plan-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.cancellation-notice {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.cancellation-notice p {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--dc-warning);
}

/* Change Plan Section */
.change-plan {
    margin-bottom: 3rem;
}

.change-plan .billing-toggle {
    display: inline-flex;
    background: var(--dc-light);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.change-plan .toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.change-plan .toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.change-plan .toggle-btn.active {
    background: white;
    box-shadow: var(--dc-shadow);
}

.change-plan .save-badge {
    font-size: 0.625rem;
    background: var(--dc-success);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Plan Cards */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plan-card {
    background: white;
    border: 2px solid var(--dc-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.2s ease;
}

.plan-card:hover {
    border-color: var(--dc-primary-light);
}

.plan-card.popular {
    border-color: var(--dc-primary);
}

.plan-card.current {
    background: rgba(8, 145, 178, 0.05);
}

.plan-card .popular-badge,
.plan-card .current-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-card .popular-badge {
    background: var(--dc-primary);
    color: white;
}

.plan-card .current-badge {
    background: var(--dc-success);
    color: white;
}

.plan-card h4 {
    margin: 0 0 0.25rem 0;
}

.plan-card .tier-description {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-bottom: 1rem;
}

.plan-card .tier-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 1rem;
}

.plan-card .tier-price .currency {
    font-size: 1rem;
    font-weight: 500;
}

.plan-card .tier-price .amount {
    font-size: 2rem;
    font-weight: 700;
}

.plan-card .tier-price .period {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.plan-card .tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.plan-card .tier-features li {
    margin-bottom: 0.25rem;
}

/* User Adjustment */
.user-adjustment {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    max-width: 400px;
}

.user-adjustment h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.user-adjustment > p {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.user-count-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.count-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--dc-border);
    border-radius: 0.5rem;
    background: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-btn:hover:not(:disabled) {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.count-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.count-value {
    font-size: 2rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.price-preview {
    background: var(--dc-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.price-row.total {
    border-top: 1px solid var(--dc-border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}

/* Cancel Section */
.cancel-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
}

.cancel-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.cancel-section p {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin: 0 0 1rem 0;
}

.modal-content p {
    color: var(--dc-text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===================================
   Billing Page Styles
   =================================== */

.billing-section {
    margin-bottom: 2rem;
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.payment-method-card {
    background: white;
    border: 2px solid var(--dc-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.payment-method-card.default {
    border-color: var(--dc-primary);
}

.card-icon {
    flex-shrink: 0;
}

.card-details {
    display: flex;
    flex-direction: column;
}

.card-brand {
    font-weight: 600;
    font-size: 0.875rem;
}

.card-number {
    font-family: monospace;
    font-size: 1rem;
}

.card-expiry {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.default-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--dc-primary);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.billing-info-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
}

.billing-info-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.billing-info-card .form-group {
    margin-bottom: 1rem;
}

.billing-info-card .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.billing-info-card .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dc-border);
    border-radius: 0.375rem;
}

.invoice-table-wrapper {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--dc-shadow);
    overflow: hidden;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--dc-border);
}

.invoice-table th {
    background: var(--dc-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    font-size: 0.875rem;
}

.invoice-table .status-badge.paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--dc-success);
}

.invoice-table .status-badge.open {
    background: rgba(245, 158, 11, 0.1);
    color: var(--dc-warning);
}

.invoice-table .status-badge.void {
    background: rgba(100, 116, 139, 0.1);
    color: var(--dc-secondary);
}

@media (max-width: 768px) {
    .subscription-card {
        flex-direction: column;
    }

    .plan-details {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .plan-actions {
        align-items: stretch;
    }

    .plan-cards {
        grid-template-columns: 1fr;
    }

    .billing-info-card .form-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* ========================================
   License Page Styles
   ======================================== */

.license-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* License Status Card */
.license-status-section .license-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.license-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--dc-primary);
}

.license-card.status-active::before { background: #22c55e; }
.license-card.status-trial::before { background: #3b82f6; }
.license-card.status-warning::before { background: #f59e0b; }
.license-card.status-danger::before { background: #ef4444; }
.license-card.status-inactive::before { background: #9ca3af; }

.license-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--dc-light);
    border-radius: 0.75rem;
    min-width: 120px;
}

.badge-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dc-primary);
    border-radius: 50%;
    color: white;
}

.status-active .badge-icon { background: #22c55e; }
.status-trial .badge-icon { background: #3b82f6; }
.status-warning .badge-icon { background: #f59e0b; }
.status-danger .badge-icon { background: #ef4444; }

.badge-status {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dc-dark);
}

.license-details {
    flex: 1;
}

.license-details h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.license-description {
    color: var(--dc-text-muted);
    margin-bottom: 1.5rem;
}

.license-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-item .label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item .value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--dc-dark);
}

.meta-item .value.code {
    font-family: monospace;
    background: var(--dc-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.meta-item .value.warning {
    color: #f59e0b;
}

.trial-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1d4ed8;
}

.trial-notice svg {
    flex-shrink: 0;
}

.trial-notice a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: underline;
}

/* Usage Section */
.usage-section h2,
.features-section h2,
.activation-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-bottom: 1rem;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.usage-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.usage-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dc-light);
    border-radius: 0.5rem;
    color: var(--dc-primary);
    flex-shrink: 0;
}

.usage-content {
    flex: 1;
    min-width: 0;
}

.usage-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
}

.usage-values {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.usage-values .current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.usage-values .separator {
    color: var(--dc-text-muted);
}

.usage-values .max {
    font-size: 1rem;
    color: var(--dc-text-muted);
}

.usage-values .note {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-left: 0.25rem;
}

.usage-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--dc-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.feature-category {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feature-category h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.feature-list li.included {
    color: var(--dc-dark);
}

.feature-list li.included svg {
    color: #22c55e;
}

.feature-list li.not-included {
    color: var(--dc-text-muted);
}

.feature-list li.not-included svg {
    color: #d1d5db;
}

.upgrade-prompt {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--dc-primary) 0%, #0d9488 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.upgrade-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.upgrade-content p {
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
}

.upgrade-prompt .btn {
    background: white;
    color: var(--dc-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.upgrade-prompt .btn:hover {
    background: var(--dc-light);
}

/* Activation Section */
.activation-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.activation-card .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.license-key {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.license-key code {
    font-family: monospace;
    font-size: 1rem;
    background: var(--dc-light);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--dc-dark);
}

.btn-copy {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--dc-light);
    border-radius: 0.375rem;
    color: var(--dc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--dc-primary);
    color: white;
}

/* Support Section */
.support-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.support-content h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.support-content p {
    margin: 0;
    color: var(--dc-text-muted);
    font-size: 0.875rem;
}

.support-actions {
    display: flex;
    gap: 0.75rem;
}

.support-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* License Page Responsive */
@media (max-width: 1024px) {
    .license-meta {
        grid-template-columns: repeat(2, 1fr);
    }

    .usage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .license-page {
        padding: 1rem;
    }

    .license-card {
        flex-direction: column;
        padding: 1.5rem;
    }

    .license-badge {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .badge-icon {
        width: 48px;
        height: 48px;
    }

    .license-meta {
        grid-template-columns: 1fr;
    }

    .usage-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .upgrade-prompt {
        flex-direction: column;
        text-align: center;
    }

    .activation-card .info-grid {
        grid-template-columns: 1fr;
    }

    .support-card {
        flex-direction: column;
        text-align: center;
    }

    .support-actions {
        flex-direction: column;
        width: 100%;
    }

    .support-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Users Page Styles
   ======================================== */

.users-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Section */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.header-content h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.header-content p {
    margin: 0;
    color: var(--dc-text-muted);
}

.header-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Usage Banner */
.usage-banner {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.usage-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.usage-stat {
    display: flex;
    flex-direction: column;
}

.usage-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.usage-stat .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
}

.usage-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usage-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--dc-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-percent {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    white-space: nowrap;
}

/* Users Table */
.users-section {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.users-table-wrapper {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: var(--dc-light);
    border-bottom: 1px solid #e5e7eb;
}

.users-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: var(--dc-dark);
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.users-table tbody tr:hover {
    background: #f9fafb;
}

.users-table tbody tr.current-user {
    background: #f0fdf4;
}

.users-table tbody tr.current-user:hover {
    background: #dcfce7;
}

/* User Info Cell */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: var(--dc-primary);
    flex-shrink: 0;
}

.user-avatar.owner { background: #8b5cf6; }
.user-avatar.admin { background: #3b82f6; }
.user-avatar.staff { background: #6b7280; }

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.current-badge {
    font-size: 0.625rem;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    display: inline-block;
}

/* Role Badge */
.role-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.role-badge.owner {
    background: #f3e8ff;
    color: #7c3aed;
}

.role-badge.admin {
    background: #dbeafe;
    color: #2563eb;
}

.role-badge.staff {
    background: #f3f4f6;
    color: #4b5563;
}

/* Status Badge */
.users-table .status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.users-table .status-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.users-table .status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--dc-text-muted);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--dc-light);
    color: var(--dc-primary);
}

.btn-icon.warning:hover {
    background: #fef3c7;
    color: #d97706;
}

.btn-icon.success:hover {
    background: #dcfce7;
    color: #16a34a;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Roles Info Section */
.roles-info-section {
    margin-top: 1rem;
}

.roles-info-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-bottom: 1rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.role-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.role-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
}

.role-icon.owner { background: #8b5cf6; }
.role-icon.admin { background: #3b82f6; }
.role-icon.staff { background: #6b7280; }

.role-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.role-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    line-height: 1.5;
}

/* Empty State */
.users-section .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.users-section .empty-state svg {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.users-section .empty-state h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.users-section .empty-state p {
    margin: 0 0 1.5rem 0;
    color: var(--dc-text-muted);
}

/* Modal Styles (reused from other modals but with some specifics) */
.users-page .modal-dialog {
    max-width: 500px;
}

.users-page .modal-dialog.modal-sm {
    max-width: 400px;
}

.users-page .form-group {
    margin-bottom: 1rem;
}

.users-page .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark);
    margin-bottom: 0.375rem;
}

.users-page .form-text {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-top: 0.25rem;
}

.users-page .alert-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.users-page .text-muted {
    color: var(--dc-text-muted) !important;
}

/* Users Page Responsive */
@media (max-width: 1024px) {
    .roles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .users-page {
        padding: 1rem;
    }

    .users-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .usage-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .usage-divider {
        display: none;
    }

    .usage-stat {
        text-align: center;
        min-width: 80px;
    }

    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }

    .users-table th:nth-child(n+3),
    .users-table td:nth-child(n+3) {
        display: none;
    }

    .users-table th:nth-child(1),
    .users-table td:nth-child(1),
    .users-table th:nth-child(2),
    .users-table td:nth-child(2),
    .users-table th:last-child,
    .users-table td:last-child {
        display: table-cell;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }

    .role-card {
        display: flex;
        text-align: left;
        gap: 1rem;
    }

    .role-icon {
        margin: 0;
        flex-shrink: 0;
    }
}

/* ========================================
   Admin Pages Styles
   ======================================== */

.admin-page {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.admin-page .stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-page .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.total { background: #6366f1; }
.stat-icon.active { background: #22c55e; }
.stat-icon.trial { background: #3b82f6; }
.stat-icon.expiring { background: #f59e0b; }
.stat-icon.expired, .stat-icon.canceled { background: #ef4444; }
.stat-icon.pastdue { background: #f97316; }
.stat-icon.revenue { background: #14b8a6; }
.stat-icon.new { background: #8b5cf6; }
.stat-icon.users { background: #0ea5e9; }

.admin-page .stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.admin-page .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.admin-page .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.revenue {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.stat-card.revenue .stat-icon {
    background: rgba(255,255,255,0.2);
}

.stat-card.revenue .stat-value,
.stat-card.revenue .stat-label {
    color: white;
}

/* Filters Section */
.filters-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    flex: 1;
    max-width: 400px;
}

.search-box svg {
    color: var(--dc-text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
}

.filter-buttons {
    display: flex;
    gap: 0.25rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.filter-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-dropdown label {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
}

.sort-dropdown select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--dc-light);
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: var(--dc-dark);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr.canceling {
    background: #fef3c7;
}

.data-table tbody tr.row-expired {
    background: #fee2e2;
}

.data-table tbody tr.row-expiring {
    background: #fef9c3;
}

/* Practice Info Cell */
.practice-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.practice-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.practice-code {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    font-family: monospace;
}

/* Contact Info Cell */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.contact-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.contact-email {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

/* Tier Badge */
.tier-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.tier-badge.solo { background: #dbeafe; color: #2563eb; }
.tier-badge.standard { background: #dcfce7; color: #16a34a; }
.tier-badge.professional { background: #f3e8ff; color: #7c3aed; }
.tier-badge.enterprise { background: #fef3c7; color: #d97706; }
.tier-badge.trial { background: #e0e7ff; color: #4338ca; }
.tier-badge.none { background: #f3f4f6; color: #6b7280; }

/* Status Badge */
.admin-page .status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.status-badge.active { background: #dcfce7; color: #16a34a; }
.status-badge.trialing, .status-badge.trial { background: #dbeafe; color: #2563eb; }
.status-badge.pastdue, .status-badge.past-due { background: #fef3c7; color: #d97706; }
.status-badge.canceled, .status-badge.expired { background: #fee2e2; color: #dc2626; }
.status-badge.expiring { background: #fef9c3; color: #ca8a04; }
.status-badge.inactive { background: #f3f4f6; color: #6b7280; }

.cancel-indicator {
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

/* Days Display */
.days-ok { color: #16a34a; }
.days-warning { color: #f59e0b; font-weight: 600; }
.days-expired { color: #ef4444; font-weight: 600; }
.expiring-soon { color: #f59e0b; font-weight: 600; }
.expired { color: #ef4444; }

/* User Count */
.user-count {
    font-family: monospace;
}

/* Action Buttons */
.admin-page .action-buttons {
    display: flex;
    gap: 0.25rem;
}

.admin-page .btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--dc-text-muted);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-page .btn-icon:hover {
    background: var(--dc-light);
    color: var(--dc-primary);
}

/* Empty State */
.admin-page .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.admin-page .empty-state svg {
    margin-bottom: 1rem;
}

.admin-page .empty-state h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.admin-page .empty-state p {
    margin: 0;
    color: var(--dc-text-muted);
}

.admin-page .loading-state {
    padding: 4rem 2rem;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.page-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Admin Modals */
.admin-page .modal-dialog.modal-lg {
    max-width: 800px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-section.full-width {
    grid-column: span 2;
}

.detail-section h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 0.875rem;
    color: var(--dc-dark);
}

.detail-item span.code {
    font-family: monospace;
    background: var(--dc-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Extend Modal */
.extend-info {
    background: var(--dc-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.extend-info p {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
}

.extend-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.extend-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.extend-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.extend-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.new-expiry {
    background: #dcfce7;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.new-expiry p {
    margin: 0;
    font-size: 0.875rem;
    color: #16a34a;
}

/* Admin Page Responsive */
@media (max-width: 1200px) {
    .stats-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-section.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .admin-page {
        padding: 1rem;
    }

    .stats-overview {
        grid-template-columns: 1fr;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================
   SETTINGS PAGE STYLES
   ============================================ */

.settings-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 2rem;
}

.settings-header h1 {
    margin-bottom: 0.5rem;
}

.settings-header .text-muted {
    color: var(--dc-text-muted);
    font-size: 0.95rem;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dc-border);
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: var(--dc-text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    background: var(--dc-white);
    color: var(--dc-text);
}

.settings-tab.active {
    background: var(--dc-white);
    color: var(--dc-primary);
    border-color: var(--dc-border);
    box-shadow: var(--dc-shadow);
}

.settings-tab svg {
    opacity: 0.7;
}

.settings-tab.active svg {
    opacity: 1;
    stroke: var(--dc-primary);
}

/* Settings Content */
.settings-content {
    background: transparent;
}

.settings-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Settings Cards */
.settings-card {
    background: var(--dc-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    border: 1px solid var(--dc-border);
}

.settings-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Form Layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--dc-text);
}

.form-control {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--dc-border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-control-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
    margin-top: 1.5rem;
}

/* Gateway Cards */
.gateway-card {
    background: var(--dc-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    border: 1px solid var(--dc-border);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.gateway-card:hover {
    box-shadow: var(--dc-shadow-lg);
}

.gateway-card.gateway-enabled {
    border-left: 4px solid var(--dc-success);
}

.gateway-card.stripe-card {
    border-left: 4px solid #635bff;
}

.gateway-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.gateway-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gateway-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.gateway-icon svg {
    width: 24px;
    height: 24px;
}

.gateway-icon.stripe { background: #635bff; }
.gateway-icon.yoco { background: #00a2e3; }
.gateway-icon.payfast { background: #00457c; }
.gateway-icon.paygate { background: #1a3a5a; }
.gateway-icon.snapscan { background: #2ecc71; }
.gateway-icon.zapper { background: #ff5722; }

.gateway-logo {
    width: 80px;
    height: 32px;
    display: flex;
    align-items: center;
}

.stripe-logo {
    color: #635bff;
}

.gateway-info h3 {
    font-size: 1.1rem;
    margin: 0;
}

.gateway-info p {
    color: var(--dc-text-muted);
    font-size: 0.85rem;
    margin: 0.25rem 0 0 0;
}

.gateway-status {
    display: flex;
    align-items: center;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-active .status-dot {
    background: #16a34a;
    animation: pulse 2s infinite;
}

.status-inactive .status-dot {
    background: #94a3b8;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch.small {
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.small .toggle-slider:before {
    height: 14px;
    width: 14px;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--dc-success);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch.small input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Gateway Details */
.gateway-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
}

.gateway-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.meta-item {
    font-size: 0.85rem;
    color: var(--dc-text-muted);
}

.meta-item strong {
    color: var(--dc-text);
}

.gateway-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dc-border);
}

.gateway-expanded-config {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dc-border);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gateway List */
.gateway-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-success {
    background: #dcfce7;
    color: #16a34a;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Template List */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--dc-light);
    border-radius: 0.5rem;
}

.template-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.template-item small {
    color: var(--dc-text-muted);
    font-size: 0.8rem;
}

/* Webhook List */
.webhook-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.webhook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--dc-light);
    border-radius: 0.5rem;
}

.webhook-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.webhook-item code {
    display: block;
    font-size: 0.8rem;
    color: var(--dc-primary);
    background: transparent;
    padding: 0;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pricing-card {
    background: var(--dc-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    border: 1px solid var(--dc-border);
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dc-shadow-lg);
}

.pricing-card.popular {
    border-color: var(--dc-primary);
    border-width: 2px;
}

.pricing-card.inactive {
    opacity: 0.6;
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dc-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-header h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.pricing-amount {
    margin-bottom: 1.5rem;
}

.pricing-amount .currency {
    font-size: 1.25rem;
    font-weight: 600;
    vertical-align: top;
}

.pricing-amount .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.pricing-amount .period {
    font-size: 0.85rem;
    color: var(--dc-text-muted);
}

.pricing-details {
    text-align: left;
    padding: 1rem 0;
    border-top: 1px solid var(--dc-border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--dc-text-muted);
}

.detail-row span:last-child {
    color: var(--dc-text);
    font-weight: 500;
}

.pricing-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
}

/* Table Styles for Settings */
.settings-section .table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.settings-section .table th,
.settings-section .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--dc-border);
}

.settings-section .table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--dc-text-muted);
    background: var(--dc-light);
}

.settings-section .table td {
    vertical-align: middle;
}

/* Responsive Settings */
@media (max-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .settings-page {
        padding: 1rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .gateway-header {
        flex-direction: column;
        gap: 1rem;
    }

    .gateway-details {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .gateway-meta {
        flex-wrap: wrap;
    }

    .settings-tabs {
        gap: 0.25rem;
    }

    .settings-tab {
        flex: 1;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .settings-tab span {
        display: none;
    }
}

/* =====================================================
   REPORTS PAGE STYLES
   ===================================================== */

.reports-page {
    padding: 2rem;
}

/* Metric Cards */
.metric-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--dc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dc-shadow-lg);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-card.revenue .metric-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.metric-card.practices .metric-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.metric-card.subscriptions .metric-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.metric-card.licenses .metric-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.metric-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dc-dark);
    line-height: 1.2;
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.metric-change.positive {
    color: var(--dc-success);
}

.metric-change.negative {
    color: var(--dc-danger);
}

.metric-change.warning {
    color: var(--dc-warning);
}

.metric-change.neutral {
    color: var(--dc-text-muted);
}

/* Report Cards */
.report-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--dc-shadow);
    height: 100%;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.report-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
}

/* Bar Chart */
.chart-container {
    height: 250px;
    padding: 1rem 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    gap: 4px;
    padding-bottom: 30px;
    position: relative;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
}

.bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, var(--dc-primary) 0%, var(--dc-primary-dark) 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bar:hover {
    background: linear-gradient(180deg, var(--dc-primary-light) 0%, var(--dc-primary) 100%);
}

.bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dc-dark);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}

.bar:hover .bar-tooltip {
    opacity: 1;
    visibility: visible;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.7rem;
    color: var(--dc-text-muted);
}

/* Tier Breakdown */
.tier-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tier-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tier-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tier-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.tier-amount {
    font-weight: 600;
    color: var(--dc-text);
}

.tier-bar {
    height: 8px;
    background: var(--dc-light);
    border-radius: 4px;
    overflow: hidden;
}

.tier-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tier-fill.tier-solo {
    background: #10b981;
}

.tier-fill.tier-standard {
    background: #3b82f6;
}

.tier-fill.tier-professional {
    background: #8b5cf6;
}

.tier-fill.tier-enterprise {
    background: #f59e0b;
}

.tier-percent {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    text-align: right;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--dc-light);
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    margin-top: 0.25rem;
}

/* Status Chart */
.status-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-row .status-label {
    width: 80px;
    font-size: 0.875rem;
    color: var(--dc-text);
}

.status-bar-container {
    flex: 1;
    height: 8px;
    background: var(--dc-light);
    border-radius: 4px;
    overflow: hidden;
}

.status-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.status-bar.status-active {
    background: var(--dc-success);
}

.status-bar.status-trial {
    background: var(--dc-info);
}

.status-bar.status-past-due {
    background: var(--dc-warning);
}

.status-bar.status-canceled {
    background: var(--dc-danger);
}

.status-count {
    width: 40px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark);
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.donut-chart {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-segment {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.donut-segment.donut-monthly {
    stroke: var(--dc-info);
}

.donut-segment.donut-yearly {
    stroke: var(--dc-success);
}

.donut-segment.donut-threeyear {
    stroke: var(--dc-warning);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-total {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.donut-label {
    display: block;
    font-size: 0.7rem;
    color: var(--dc-text-muted);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.legend-monthly {
    background: var(--dc-info);
}

.legend-color.legend-yearly {
    background: var(--dc-success);
}

.legend-color.legend-threeyear {
    background: var(--dc-warning);
}

.legend-label {
    font-size: 0.875rem;
    color: var(--dc-text);
}

.legend-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-left: auto;
}

/* Tier Distribution */
.tier-distribution {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tier-dist-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 1rem;
    align-items: center;
}

.tier-dist-info {
    display: flex;
    flex-direction: column;
}

.tier-dist-name {
    font-weight: 600;
    color: var(--dc-dark);
}

.tier-dist-price {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.tier-dist-bar-container {
    height: 12px;
    background: var(--dc-light);
    border-radius: 6px;
    overflow: hidden;
}

.tier-dist-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.tier-dist-bar.tier-solo {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.tier-dist-bar.tier-standard {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.tier-dist-bar.tier-professional {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.tier-dist-bar.tier-enterprise {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.tier-dist-stats {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.tier-dist-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark);
}

.tier-dist-users {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

/* License Status Grid */
.license-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.license-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.license-status-card.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.license-status-card.expiring {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.license-status-card.expired {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.license-status-card.trial {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.license-status-card .status-count {
    width: auto;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: inherit;
}

.license-status-card .status-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Expiring List */
.expiring-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.expiring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--dc-light);
    border-radius: 8px;
}

.expiring-info {
    display: flex;
    flex-direction: column;
}

.expiring-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.expiring-tier {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
}

.expiring-date {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.expiring-date.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.expiring-date.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Responsive Reports */
@media (max-width: 992px) {
    .reports-page {
        padding: 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 200px;
    }

    .license-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tier-dist-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .tier-dist-stats {
        text-align: left;
        flex-direction: row;
        gap: 1rem;
    }

    .donut-chart-container {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .license-status-grid {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        overflow-x: auto;
        padding-bottom: 40px;
    }

    .bar-label {
        transform: rotate(-45deg);
        transform-origin: top center;
    }
}

/* =====================================================
   SUBSCRIPTIONS ADMIN PAGE STYLES
   ===================================================== */

.subscriptions-admin {
    padding: 2rem;
}

/* Stats Overview */
.subscriptions-admin .stats-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.subscriptions-admin .stat-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--dc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.subscriptions-admin .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dc-shadow-lg);
}

.subscriptions-admin .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscriptions-admin .stat-icon.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.subscriptions-admin .stat-icon.trial {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.subscriptions-admin .stat-icon.pastdue {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.subscriptions-admin .stat-icon.canceled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.subscriptions-admin .stat-icon.revenue {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.subscriptions-admin .stat-content {
    display: flex;
    flex-direction: column;
}

.subscriptions-admin .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark);
}

.subscriptions-admin .stat-label {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
}

/* Filters Section */
.subscriptions-admin .filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.subscriptions-admin .search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--dc-white);
    border: 1px solid var(--dc-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    min-width: 320px;
}

.subscriptions-admin .search-box svg {
    color: var(--dc-text-muted);
    flex-shrink: 0;
}

.subscriptions-admin .search-box input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--dc-text);
    background: transparent;
}

.subscriptions-admin .search-box input::placeholder {
    color: var(--dc-text-muted);
}

.subscriptions-admin .filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.subscriptions-admin .filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: var(--dc-white);
    color: var(--dc-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.subscriptions-admin .filter-btn:hover {
    background: var(--dc-light);
}

.subscriptions-admin .filter-btn.active {
    background: var(--dc-primary);
    color: white;
    border-color: var(--dc-primary);
}

/* Table Section */
.subscriptions-admin .table-section {
    background: var(--dc-white);
    border-radius: 12px;
    box-shadow: var(--dc-shadow);
    overflow: hidden;
}

.subscriptions-admin .loading-state,
.subscriptions-admin .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.subscriptions-admin .empty-state h3 {
    margin: 1rem 0 0.5rem;
    color: var(--dc-dark);
}

.subscriptions-admin .empty-state p {
    color: var(--dc-text-muted);
    margin: 0;
}

.subscriptions-admin .table-wrapper {
    overflow-x: auto;
}

.subscriptions-admin .data-table {
    width: 100%;
    border-collapse: collapse;
}

.subscriptions-admin .data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dc-text-muted);
    background: var(--dc-light);
    border-bottom: 1px solid var(--dc-border);
}

.subscriptions-admin .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--dc-border);
    font-size: 0.9rem;
    color: var(--dc-text);
}

.subscriptions-admin .data-table tbody tr {
    transition: background-color 0.2s;
}

.subscriptions-admin .data-table tbody tr:hover {
    background-color: rgba(8, 145, 178, 0.04);
}

.subscriptions-admin .data-table tbody tr.canceling {
    background-color: rgba(245, 158, 11, 0.05);
}

/* Practice Info */
.subscriptions-admin .practice-info {
    display: flex;
    flex-direction: column;
}

.subscriptions-admin .practice-name {
    font-weight: 600;
    color: var(--dc-dark);
}

.subscriptions-admin .practice-code {
    font-size: 0.75rem;
    color: var(--dc-text-muted);
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Tier Badges */
.subscriptions-admin .tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subscriptions-admin .tier-badge.solo {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.subscriptions-admin .tier-badge.standard {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.subscriptions-admin .tier-badge.professional {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

.subscriptions-admin .tier-badge.enterprise {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* Status Badges */
.subscriptions-admin .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subscriptions-admin .status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.subscriptions-admin .status-badge.trialing {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.subscriptions-admin .status-badge.pastdue {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.subscriptions-admin .status-badge.canceled {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.subscriptions-admin .status-badge.incomplete,
.subscriptions-admin .status-badge.incompleteexpired,
.subscriptions-admin .status-badge.unpaid {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.subscriptions-admin .cancel-indicator {
    font-size: 0.65rem;
    opacity: 0.8;
}

.subscriptions-admin .expiring-soon {
    color: var(--dc-warning);
    font-weight: 600;
}

/* Action Buttons */
.subscriptions-admin .action-buttons {
    display: flex;
    gap: 0.5rem;
}

.subscriptions-admin .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    color: var(--dc-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.subscriptions-admin .btn-icon:hover {
    background: var(--dc-light);
    color: var(--dc-primary);
    border-color: var(--dc-primary);
}

/* Modal Styles */
.subscriptions-admin .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.subscriptions-admin .modal-dialog {
    background: var(--dc-white);
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.subscriptions-admin .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.subscriptions-admin .modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.subscriptions-admin .modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--dc-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.subscriptions-admin .modal-close:hover {
    background: var(--dc-light);
    color: var(--dc-text);
}

.subscriptions-admin .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.subscriptions-admin .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dc-border);
}

/* Detail Grid */
.subscriptions-admin .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.subscriptions-admin .detail-section {
    background: var(--dc-light);
    border-radius: 8px;
    padding: 1rem;
}

.subscriptions-admin .detail-section.full-width {
    grid-column: span 2;
}

.subscriptions-admin .detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-text-muted);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subscriptions-admin .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dc-border);
}

.subscriptions-admin .detail-item:last-child {
    border-bottom: none;
}

.subscriptions-admin .detail-item label {
    font-size: 0.875rem;
    color: var(--dc-text-muted);
}

.subscriptions-admin .detail-item span {
    font-weight: 500;
    color: var(--dc-dark);
}

.subscriptions-admin .detail-item .code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    background: var(--dc-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
    .subscriptions-admin .stats-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .subscriptions-admin {
        padding: 1rem;
    }

    .subscriptions-admin .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .subscriptions-admin .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .subscriptions-admin .search-box {
        min-width: 100%;
    }

    .subscriptions-admin .filter-buttons {
        justify-content: center;
    }

    .subscriptions-admin .detail-grid {
        grid-template-columns: 1fr;
    }

    .subscriptions-admin .detail-section.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 576px) {
    .subscriptions-admin .stats-overview {
        grid-template-columns: 1fr;
    }

    .subscriptions-admin .filter-buttons {
        width: 100%;
    }

    .subscriptions-admin .filter-btn {
        flex: 1;
        text-align: center;
    }

    .subscriptions-admin .data-table th,
    .subscriptions-admin .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   Admin Customers Page Styles
   ============================================ */

.customers-admin {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Stats Overview */
.customers-admin .stats-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.customers-admin .stat-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.customers-admin .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.customers-admin .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customers-admin .stat-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.customers-admin .stat-icon.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.customers-admin .stat-icon.trial {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.customers-admin .stat-icon.new {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.customers-admin .stat-icon.users {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.customers-admin .stat-content {
    display: flex;
    flex-direction: column;
}

.customers-admin .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dc-dark);
    line-height: 1.2;
}

.customers-admin .stat-label {
    font-size: 0.875rem;
    color: var(--dc-muted);
}

/* Filters Section */
.customers-admin .filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--dc-white);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.customers-admin .search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--dc-light);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    min-width: 350px;
    flex: 1;
}

.customers-admin .search-box svg {
    color: var(--dc-muted);
    flex-shrink: 0;
}

.customers-admin .search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--dc-dark);
}

.customers-admin .search-box input::placeholder {
    color: var(--dc-muted);
}

.customers-admin .filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.customers-admin .filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    color: var(--dc-muted);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customers-admin .filter-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.customers-admin .filter-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.customers-admin .sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.customers-admin .sort-dropdown label {
    font-size: 0.875rem;
    color: var(--dc-muted);
    white-space: nowrap;
}

.customers-admin .sort-dropdown select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--dc-border);
    border-radius: 6px;
    background: var(--dc-white);
    font-size: 0.875rem;
    color: var(--dc-dark);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

/* Table Section */
.customers-admin .table-section {
    background: var(--dc-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.customers-admin .loading-state,
.customers-admin .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.customers-admin .empty-state svg {
    margin-bottom: 1rem;
}

.customers-admin .empty-state h3 {
    font-size: 1.25rem;
    color: var(--dc-dark);
    margin-bottom: 0.5rem;
}

.customers-admin .empty-state p {
    color: var(--dc-muted);
}

.customers-admin .table-wrapper {
    overflow-x: auto;
}

.customers-admin .data-table {
    width: 100%;
    border-collapse: collapse;
}

.customers-admin .data-table th {
    background: var(--dc-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dc-muted);
    border-bottom: 1px solid var(--dc-border);
    white-space: nowrap;
}

.customers-admin .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--dc-border);
    vertical-align: middle;
}

.customers-admin .data-table tbody tr:hover {
    background: var(--dc-light);
}

.customers-admin .data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Practice Info */
.customers-admin .practice-info {
    display: flex;
    flex-direction: column;
}

.customers-admin .practice-name {
    font-weight: 600;
    color: var(--dc-dark);
}

.customers-admin .practice-code {
    font-size: 0.8rem;
    color: var(--dc-muted);
    font-family: monospace;
}

/* Contact Info */
.customers-admin .contact-info {
    display: flex;
    flex-direction: column;
}

.customers-admin .contact-name {
    font-weight: 500;
    color: var(--dc-dark);
}

.customers-admin .contact-email {
    font-size: 0.8rem;
    color: var(--dc-muted);
}

/* User Count */
.customers-admin .user-count {
    font-weight: 500;
    color: var(--dc-dark);
}

/* Tier Badges */
.customers-admin .tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.customers-admin .tier-badge.solo {
    background: #e0f2fe;
    color: #0369a1;
}

.customers-admin .tier-badge.standard {
    background: #f0fdf4;
    color: #15803d;
}

.customers-admin .tier-badge.professional {
    background: #fef3c7;
    color: #b45309;
}

.customers-admin .tier-badge.enterprise {
    background: #fae8ff;
    color: #a21caf;
}

.customers-admin .tier-badge.none {
    background: var(--dc-light);
    color: var(--dc-muted);
}

/* Status Badges */
.customers-admin .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.customers-admin .status-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.customers-admin .status-badge.trial {
    background: #dbeafe;
    color: #1d4ed8;
}

.customers-admin .status-badge.expired,
.customers-admin .status-badge.past {
    background: #fee2e2;
    color: #dc2626;
}

.customers-admin .status-badge.canceled {
    background: var(--dc-light);
    color: var(--dc-muted);
}

.customers-admin .status-badge.inactive {
    background: #fef3c7;
    color: #b45309;
}

/* Expiring Soon */
.customers-admin .expiring-soon {
    color: #f59e0b;
    font-weight: 500;
}

/* Action Buttons */
.customers-admin .action-buttons {
    display: flex;
    gap: 0.5rem;
}

.customers-admin .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--dc-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-muted);
    transition: all 0.2s ease;
}

.customers-admin .btn-icon:hover {
    background: var(--dc-primary);
    color: white;
}

/* Pagination */
.customers-admin .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--dc-border);
}

.customers-admin .page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-dark);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.customers-admin .page-btn:hover:not(:disabled) {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.customers-admin .page-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.customers-admin .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.customers-admin .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.customers-admin .modal-dialog {
    background: var(--dc-white);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.customers-admin .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.customers-admin .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0;
}

.customers-admin .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dc-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-muted);
    transition: all 0.2s ease;
}

.customers-admin .modal-close:hover {
    background: var(--dc-danger);
    color: white;
}

.customers-admin .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.customers-admin .detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.customers-admin .detail-section {
    background: var(--dc-light);
    border-radius: 12px;
    padding: 1.25rem;
}

.customers-admin .detail-section.full-width {
    grid-column: span 2;
}

.customers-admin .detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.customers-admin .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dc-border);
}

.customers-admin .detail-item:last-child {
    border-bottom: none;
}

.customers-admin .detail-item label {
    font-size: 0.8rem;
    color: var(--dc-muted);
    flex-shrink: 0;
}

.customers-admin .detail-item span {
    font-weight: 500;
    color: var(--dc-dark);
    text-align: right;
}

.customers-admin .detail-item .code {
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--dc-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.customers-admin .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
}

/* Responsive */
@media (max-width: 1200px) {
    .customers-admin .stats-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .customers-admin {
        padding: 1rem;
    }

    .customers-admin .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .customers-admin .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .customers-admin .search-box {
        min-width: 100%;
    }

    .customers-admin .filter-buttons {
        justify-content: center;
    }

    .customers-admin .sort-dropdown {
        margin-left: 0;
        justify-content: center;
    }

    .customers-admin .detail-grid {
        grid-template-columns: 1fr;
    }

    .customers-admin .detail-section.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .customers-admin .modal-actions {
        flex-direction: column;
    }

    .customers-admin .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .customers-admin .stats-overview {
        grid-template-columns: 1fr;
    }

    .customers-admin .filter-buttons {
        width: 100%;
    }

    .customers-admin .filter-btn {
        flex: 1;
        text-align: center;
    }

    .customers-admin .data-table th,
    .customers-admin .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .customers-admin .action-buttons {
        flex-direction: column;
    }
}

/* ============================================
   Admin Licenses Page Styles
   ============================================ */

.licenses-admin {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Stats Overview */
.licenses-admin .stats-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.licenses-admin .stat-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.licenses-admin .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.licenses-admin .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.licenses-admin .stat-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.licenses-admin .stat-icon.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.licenses-admin .stat-icon.expiring {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.licenses-admin .stat-icon.expired {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.licenses-admin .stat-icon.trial {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.licenses-admin .stat-content {
    display: flex;
    flex-direction: column;
}

.licenses-admin .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dc-dark);
    line-height: 1.2;
}

.licenses-admin .stat-label {
    font-size: 0.875rem;
    color: var(--dc-muted);
}

/* Filters Section */
.licenses-admin .filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--dc-white);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.licenses-admin .search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--dc-light);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    min-width: 300px;
    flex: 1;
    max-width: 400px;
}

.licenses-admin .search-box svg {
    color: var(--dc-muted);
    flex-shrink: 0;
}

.licenses-admin .search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--dc-dark);
}

.licenses-admin .search-box input::placeholder {
    color: var(--dc-muted);
}

.licenses-admin .filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.licenses-admin .filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    color: var(--dc-muted);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.licenses-admin .filter-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.licenses-admin .filter-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

/* Table Section */
.licenses-admin .table-section {
    background: var(--dc-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.licenses-admin .loading-state,
.licenses-admin .empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.licenses-admin .empty-state svg {
    margin-bottom: 1rem;
}

.licenses-admin .empty-state h3 {
    font-size: 1.25rem;
    color: var(--dc-dark);
    margin-bottom: 0.5rem;
}

.licenses-admin .empty-state p {
    color: var(--dc-muted);
}

.licenses-admin .table-wrapper {
    overflow-x: auto;
}

.licenses-admin .data-table {
    width: 100%;
    border-collapse: collapse;
}

.licenses-admin .data-table th {
    background: var(--dc-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dc-muted);
    border-bottom: 1px solid var(--dc-border);
    white-space: nowrap;
}

.licenses-admin .data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--dc-border);
    vertical-align: middle;
}

.licenses-admin .data-table tbody tr:hover {
    background: var(--dc-light);
}

.licenses-admin .data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row States */
.licenses-admin .data-table tr.row-expired {
    background: #fef2f2;
}

.licenses-admin .data-table tr.row-expired:hover {
    background: #fee2e2;
}

.licenses-admin .data-table tr.row-expiring {
    background: #fffbeb;
}

.licenses-admin .data-table tr.row-expiring:hover {
    background: #fef3c7;
}

/* Practice Info */
.licenses-admin .practice-info {
    display: flex;
    flex-direction: column;
}

.licenses-admin .practice-name {
    font-weight: 600;
    color: var(--dc-dark);
}

.licenses-admin .practice-code {
    font-size: 0.8rem;
    color: var(--dc-muted);
    font-family: monospace;
}

/* Tier Badges */
.licenses-admin .tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.licenses-admin .tier-badge.trial {
    background: #dbeafe;
    color: #1d4ed8;
}

.licenses-admin .tier-badge.solo {
    background: #e0f2fe;
    color: #0369a1;
}

.licenses-admin .tier-badge.standard {
    background: #f0fdf4;
    color: #15803d;
}

.licenses-admin .tier-badge.professional {
    background: #fef3c7;
    color: #b45309;
}

.licenses-admin .tier-badge.enterprise {
    background: #fae8ff;
    color: #a21caf;
}

.licenses-admin .tier-badge.none {
    background: var(--dc-light);
    color: var(--dc-muted);
}

/* Status Badges */
.licenses-admin .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.licenses-admin .status-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.licenses-admin .status-badge.expiring {
    background: #fef3c7;
    color: #b45309;
}

.licenses-admin .status-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

.licenses-admin .status-badge.inactive {
    background: var(--dc-light);
    color: var(--dc-muted);
}

/* Days Remaining */
.licenses-admin .days-ok {
    color: #15803d;
    font-weight: 500;
}

.licenses-admin .days-warning {
    color: #f59e0b;
    font-weight: 600;
}

.licenses-admin .days-expired {
    color: #dc2626;
    font-weight: 600;
}

.licenses-admin .expiring-soon {
    color: #f59e0b;
    font-weight: 500;
}

.licenses-admin .expired {
    color: #dc2626;
    font-weight: 500;
}

/* Action Buttons */
.licenses-admin .action-buttons {
    display: flex;
    gap: 0.5rem;
}

.licenses-admin .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--dc-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-muted);
    transition: all 0.2s ease;
}

.licenses-admin .btn-icon:hover {
    background: var(--dc-primary);
    color: white;
}

/* Modal */
.licenses-admin .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.licenses-admin .modal-dialog {
    background: var(--dc-white);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.licenses-admin .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.licenses-admin .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0;
}

.licenses-admin .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dc-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-muted);
    transition: all 0.2s ease;
}

.licenses-admin .modal-close:hover {
    background: var(--dc-danger);
    color: white;
}

.licenses-admin .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Extend Modal */
.licenses-admin .extend-info {
    background: var(--dc-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.licenses-admin .extend-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--dc-dark);
}

.licenses-admin .extend-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.licenses-admin .extend-btn {
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    color: var(--dc-dark);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.licenses-admin .extend-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.licenses-admin .extend-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.licenses-admin .new-expiry {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.licenses-admin .new-expiry p {
    margin: 0;
    font-size: 1rem;
}

/* Form Groups */
.licenses-admin .form-group {
    margin-bottom: 1rem;
}

.licenses-admin .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark);
    margin-bottom: 0.5rem;
}

.licenses-admin .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--dc-border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--dc-dark);
    background: var(--dc-white);
    transition: border-color 0.2s ease;
}

.licenses-admin .form-control:focus {
    outline: none;
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.licenses-admin textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.licenses-admin select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Modal Actions */
.licenses-admin .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
}

/* Responsive */
@media (max-width: 1200px) {
    .licenses-admin .stats-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .licenses-admin {
        padding: 1rem;
    }

    .licenses-admin .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .licenses-admin .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .licenses-admin .search-box {
        min-width: 100%;
        max-width: 100%;
    }

    .licenses-admin .filter-buttons {
        justify-content: center;
    }

    .licenses-admin .extend-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .licenses-admin .modal-actions {
        flex-direction: column;
    }

    .licenses-admin .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .licenses-admin .stats-overview {
        grid-template-columns: 1fr;
    }

    .licenses-admin .filter-buttons {
        width: 100%;
    }

    .licenses-admin .filter-btn {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .licenses-admin .data-table th,
    .licenses-admin .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .licenses-admin .action-buttons {
        flex-direction: column;
    }

    .licenses-admin .extend-options {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   Admin Permissions Page Styles
   ============================================ */

.permissions-admin {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.permissions-admin .page-header {
    margin-bottom: 2rem;
}

.permissions-admin .page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dc-dark);
    margin: 0 0 0.5rem 0;
}

.permissions-admin .page-header p {
    color: var(--dc-muted);
    margin: 0;
}

/* Role Bundles Section */
.permissions-admin .role-bundles {
    margin-bottom: 2rem;
}

.permissions-admin .role-bundles h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-bottom: 1rem;
}

.permissions-admin .bundle-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.permissions-admin .bundle-card {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.permissions-admin .bundle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.permissions-admin .bundle-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0 0 0.5rem 0;
}

.permissions-admin .bundle-description {
    font-size: 0.8rem;
    color: var(--dc-muted);
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.permissions-admin .bundle-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.permissions-admin .perm-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: var(--dc-light);
    color: var(--dc-muted);
    border-radius: 4px;
}

.permissions-admin .perm-tag.more {
    background: var(--dc-primary);
    color: white;
}

/* Users Section */
.permissions-admin .users-section {
    background: var(--dc-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.permissions-admin .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.permissions-admin .section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0;
}

.permissions-admin .search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--dc-light);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 250px;
}

.permissions-admin .search-box svg {
    color: var(--dc-muted);
    flex-shrink: 0;
}

.permissions-admin .search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--dc-dark);
}

.permissions-admin .loading-state {
    padding: 3rem;
    text-align: center;
}

/* Users Grid */
.permissions-admin .users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.permissions-admin .user-card {
    background: var(--dc-light);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.permissions-admin .user-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.permissions-admin .user-card.super-admin {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
}

.permissions-admin .user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.permissions-admin .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dc-primary) 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

.permissions-admin .user-card.super-admin .user-avatar {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.permissions-admin .user-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0 0 0.25rem 0;
}

.permissions-admin .user-info .username {
    font-size: 0.8rem;
    color: var(--dc-muted);
}

.permissions-admin .super-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.permissions-admin .user-details {
    margin-bottom: 1rem;
}

.permissions-admin .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.85rem;
}

.permissions-admin .detail-row .label {
    color: var(--dc-muted);
}

.permissions-admin .detail-row .value {
    color: var(--dc-dark);
    font-weight: 500;
}

.permissions-admin .status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.permissions-admin .status-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.permissions-admin .status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.permissions-admin .user-permissions {
    padding: 0.5rem 0;
    border-top: 1px solid var(--dc-border);
    margin-bottom: 0.75rem;
}

.permissions-admin .perm-count {
    font-size: 0.85rem;
    color: var(--dc-primary);
    font-weight: 500;
}

.permissions-admin .user-actions {
    display: flex;
    gap: 0.5rem;
}

.permissions-admin .user-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.permissions-admin .super-admin-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #b45309;
    margin-top: 0.5rem;
}

/* Modal */
.permissions-admin .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.permissions-admin .modal-dialog {
    background: var(--dc-white);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.permissions-admin .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.permissions-admin .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin: 0;
}

.permissions-admin .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dc-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-muted);
    transition: all 0.2s ease;
}

.permissions-admin .modal-close:hover {
    background: var(--dc-danger);
    color: white;
}

.permissions-admin .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Quick Roles */
.permissions-admin .quick-roles {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dc-border);
}

.permissions-admin .quick-roles label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark);
    margin-bottom: 0.75rem;
}

.permissions-admin .role-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.permissions-admin .role-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--dc-border);
    background: var(--dc-white);
    color: var(--dc-dark);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permissions-admin .role-btn:hover {
    border-color: var(--dc-primary);
    color: var(--dc-primary);
}

.permissions-admin .role-btn.active {
    background: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.permissions-admin .role-btn.clear {
    border-color: #ef4444;
    color: #ef4444;
}

.permissions-admin .role-btn.clear:hover {
    background: #ef4444;
    color: white;
}

/* Permission Categories */
.permissions-admin .permission-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.permissions-admin .permission-category {
    background: var(--dc-light);
    border-radius: 8px;
    overflow: hidden;
}

.permissions-admin .permission-category h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
}

.permissions-admin .category-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dc-dark);
    cursor: pointer;
    text-align: left;
}

.permissions-admin .category-toggle svg {
    transition: transform 0.2s ease;
}

.permissions-admin .category-toggle svg.expanded {
    transform: rotate(90deg);
}

.permissions-admin .category-count {
    padding: 0.25rem 0.75rem;
    margin-right: 1rem;
    background: var(--dc-white);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dc-muted);
}

.permissions-admin .permission-list {
    padding: 0 1rem 1rem 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.permissions-admin .permission-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--dc-white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.permissions-admin .permission-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.permissions-admin .permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--dc-primary);
}

.permissions-admin .permission-info {
    display: flex;
    flex-direction: column;
}

.permissions-admin .permission-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark);
}

.permissions-admin .permission-desc {
    font-size: 0.75rem;
    color: var(--dc-muted);
    margin-top: 0.25rem;
}

/* Modal Actions */
.permissions-admin .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dc-border);
}

/* Responsive */
@media (max-width: 1200px) {
    .permissions-admin .bundle-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .permissions-admin {
        padding: 1rem;
    }

    .permissions-admin .bundle-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .permissions-admin .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .permissions-admin .search-box {
        min-width: 100%;
    }

    .permissions-admin .permission-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .permissions-admin .bundle-cards {
        grid-template-columns: 1fr;
    }

    .permissions-admin .users-grid {
        grid-template-columns: 1fr;
    }

    .permissions-admin .modal-dialog {
        max-height: 95vh;
    }

    .permissions-admin .role-buttons {
        flex-direction: column;
    }

    .permissions-admin .role-btn {
        width: 100%;
        text-align: center;
    }

    .permissions-admin .modal-actions {
        flex-direction: column;
    }

    .permissions-admin .modal-actions button {
        width: 100%;
    }
}

/* ============================================
   ACCESS DENIED / PERMISSION GUARD STYLES
   ============================================ */

.permission-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.access-denied-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.access-denied-card {
    text-align: center;
    max-width: 500px;
    padding: 3rem 2rem;
    background: var(--dc-white);
    border-radius: 16px;
    box-shadow: var(--dc-shadow-lg);
}

.access-denied-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.access-denied-icon svg {
    stroke: var(--dc-danger);
}

.access-denied-card h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dc-dark);
    margin-bottom: 1rem;
}

.access-denied-message {
    color: var(--dc-text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.required-permission {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.required-permission strong {
    color: var(--dc-dark);
}

.access-denied-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.access-denied-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.access-denied-help {
    color: var(--dc-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

@media (max-width: 576px) {
    .access-denied-card {
        padding: 2rem 1rem;
    }

    .access-denied-actions {
        flex-direction: column;
    }

    .access-denied-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
