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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    max-width: 500px;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.icon-header {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

h2 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    color: #1a1a1a;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.help-text {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

/* Forms */
form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.mono {
    font-family: 'Courier New', monospace;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: #f3f4f6;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-text {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-text:hover {
    color: #666;
}

.btn-logout {
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-logout:hover {
    background: #dc2626;
}

.link-section {
    text-align: center;
    margin-top: 20px;
}

.link-section p {
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    font-size: 14px;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.info {
    background: #3b82f6;
}

.toast.warning {
    background: #f59e0b;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
}

.alert-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.alert-icon {
    font-size: 24px;
    margin-right: 12px;
}

.alert h3 {
    font-size: 18px;
    color: #065f46;
    margin-bottom: 4px;
}

.alert-success p {
    color: #065f46;
    font-size: 14px;
}

.alert-warning p {
    color: #92400e;
    font-size: 14px;
}

/* Header Bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-active {
    border-left: 4px solid #10b981;
}

.stat-disabled {
    border-left: 4px solid #f59e0b;
}

.stat-pending {
    border-left: 4px solid #ef4444;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
}

.stat-icon {
    font-size: 48px;
    opacity: 0.3;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.info-item {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

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

/* Tables */
.section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-x: auto;
}

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

thead {
    background: #f9fafb;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

tr:hover {
    background: #f9fafb;
}

.no-data {
    text-align: center;
    color: #9ca3af;
    padding: 40px !important;
}

.text-danger {
    color: #ef4444;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Pricing Box */
.pricing-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.pricing-box h3 {
    color: white;
    margin-bottom: 20px;
}

.price {
    margin-bottom: 24px;
}

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

.period {
    font-size: 18px;
    opacity: 0.9;
}

.features {
    list-style: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.features li {
    padding: 8px 0;
    font-size: 14px;
}

/* Apps Section */
.apps-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.app-card {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.app-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.app-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.app-card p {
    font-size: 13px;
    color: #666;
}

/* Stripe Element */
.stripe-element {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.stripe-element.StripeElement--focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.stripe-element.StripeElement--invalid {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: -10px;
    margin-bottom: 15px;
}

.text-warning {
    color: #f59e0b;
}

/* Action buttons in tables */
.btn-delete {
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid, .info-grid, .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .header-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
}