/* Reset & Base Fonts */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* ==================== LOGIN PAGE STYLING ==================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-badge-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.login-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-header .subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-group .input-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.input-icon-group input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s ease;
}

.input-icon-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #94a3b8;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}

/* ==================== DASHBOARD & FORMS ==================== */
.dashboard-body {
    background: #f1f5f9;
    padding: 24px;
}

.dashboard-container {
    max-width: 1280px;
    margin: 0 auto;
}

.saas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.saas-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.saas-badge {
    background: #3b82f6;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.saas-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.saas-header h2 span {
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.add-btn {
    background: #10b981;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.add-btn:hover { background: #059669; }

.logout-link {
    background: #f1f5f9;
    color: #64748b;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logout-link:hover { color: #ef4444; background: #fee2e2; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-card .stat-icon { background: #ecfdf5; color: #10b981; }
.expired-card .stat-icon { background: #fff7ed; color: #f97316; }
.blocked-card .stat-icon { background: #fef2f2; color: #ef4444; }

.stat-card h3 { font-size: 24px; font-weight: 800; color: #0f172a; }
.stat-card p { font-size: 13px; color: #64748b; font-weight: 500; }

/* Tabs */
.tabs-wrapper { margin-bottom: 16px; }
.tabs { display: flex; gap: 8px; }
.tab-btn {
    padding: 10px 18px;
    background: #e2e8f0;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.tab-btn.active { background: #3b82f6; color: white; }

/* Table */
.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.saas-table th {
    background: #f8fafc;
    padding: 14px 18px;
    font-size: 12px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
}

.saas-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
}

.logo-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.no-logo-text { font-size: 9px; color: #94a3b8; font-weight: 600; }

.logo-upload-form { display: inline-block; margin-top: 4px; }
.btn-upload-icon {
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
}
.btn-upload-icon input { display: none; }

.comp-title { display: block; color: #0f172a; font-size: 15px; }
.username-sub { color: #64748b; font-size: 12px; }

.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-pill.active { background: #dcfce7; color: #15803d; }
.status-pill.blocked { background: #fee2e2; color: #b91c1c; }
.status-pill.lifetime { background: #e0e7ff; color: #4338ca; }

.badge-pill { background: #f1f5f9; padding: 4px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.prefix-tag { background: #fef3c7; color: #b45309; padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 12px; }

/* Buttons */
.action-flex { display: flex; gap: 6px; justify-content: flex-end; }
.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn-info { background: #e0f2fe; color: #0369a1; }
.btn-warning { background: #fef3c7; color: #b45309; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-success { background: #dcfce7; color: #15803d; }

.empty-row-state { text-align: center; padding: 40px !important; color: #94a3b8; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-box {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    padding: 24px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { font-size: 24px; cursor: pointer; color: #64748b; }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }

/* Create Form Wrapper */
.form-wrapper { max-width: 640px; margin: 40px auto; }
.form-card { background: white; padding: 32px; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.form-header { margin-bottom: 24px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full-width { grid-column: span 2; }
.form-grid input[type="text"], .form-grid input[type="password"], .form-grid input[type="number"], .form-grid input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}
.checkbox-inline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.form-actions { margin-top: 24px; display: flex; gap: 10px; }
.btn-save { background: #3b82f6; color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: #e2e8f0; color: #475569; text-decoration: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; }

/*------------------manage features------------------------------------*/

/* Manage Features Specific Grid & Card Styles */
.features-list-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

.feature-checkbox-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.feature-checkbox-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.feature-checkbox-card.selected {
    border-color: #6366f1;
    background: #f5f3ff;
}

.feature-checkbox-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.feature-checkbox-card label {
    cursor: pointer;
    width: 100%;
}

.feature-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.feature-card-header strong {
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
}

.feature-slug-badge {
    font-size: 11px;
    font-family: monospace;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.feature-checkbox-card.selected .feature-slug-badge {
    background: #ddd6fe;
    color: #5b21b6;
}

.feature-desc {
    display: block;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.4;
}