/*
 * Dashboard Common Styles - SSL eCommerce
 * =========================================
 * Shared styles for all authenticated dashboard pages.
 * Included via dashboard_layout.php which is the base for all
 * post-login pages: dashboard, profile, certificates, orders, tools, support.
 */

/* ===================================================
   CARD / PANEL BASE
   =================================================== */

.dash-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.dash-card-sm {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
}

/* All major card-like containers get consistent base appearance */
.dashboard-card,
.profile-section,
.filters-card,
.order-card,
.stat-card,
.contact-card,
.tool-card-modern,
.filters-section,
.certificates-section,
.status-legend,
.no-orders-container,
.support-pin-card + *,
.quick-help-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ===================================================
   PAGE HEADER
   =================================================== */

.dash-page-header,
.page-header,
.orders-header-section {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.dash-page-header h1,
.page-header h1,
.orders-header-section h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px 0;
    font-family: var(--font-heading);
}

.dash-page-header p,
.page-header p,
.orders-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================================
   SECTION HEADERS (inside cards)
   =================================================== */

.section-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 4px 0;
}

.section-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Card header row (title + link) */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.view-all-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===================================================
   ALERT / FLASH MESSAGES
   =================================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert i,
.alert .material-icons {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ===================================================
   BUTTONS
   =================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

/* ===================================================
   FORM ELEMENTS
   =================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: #ef4444;
}

.form-input,
.modern-input,
.filter-select,
.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus,
.modern-input:focus,
.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 119, 37, 0.1);
}

.form-input:disabled {
    background: #f8fafc;
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-row .form-group:only-child {
    grid-column: 1 / -1;
}

.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.error-text {
    font-size: 12px;
    color: #ef4444;
    margin-top: 2px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ===================================================
   STATUS BADGES
   =================================================== */

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.status-badge.success,
.status-issued {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-badge.warning,
.status-pending {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
}

.status-badge.info,
.status-processing {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.status-badge.danger,
.status-failed {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-badge.secondary,
.status-refunded {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-validation {
    background: #fff7ed;
    color: #9a3412;
    border: 1px dashed #fdba74;
}

.status-expired {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

/* ===================================================
   DIVIDERS & HELPERS
   =================================================== */

.section-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 24px 0;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

/* ===================================================
   EMPTY STATE
   =================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

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

    .btn {
        justify-content: center;
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
