/* ===== Base layout ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
    min-height: 100vh;
}

/* Centered container (for login) */
.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
    padding: 28px 24px;
}

.card--small {
    max-width: 420px;
    width: 100%;
}

/* Headings */
.card__title {
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    margin-bottom: 6px;
}

.card__subtitle {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 18px;
}

/* Form elements */
.label {
    display: block;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
}

.input {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
}

.input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
    transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.45);
    opacity: 0.96;
}

.button--secondary {
    background: #10b981;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
}

.button--pill {
    border-radius: 999px;
}

/* Error / info boxes */
.alert {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 10px;
}

.alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.text-muted {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 10px;
}

/* ===== Header + main layout ===== */
.app-header {
    background: linear-gradient(135deg, #4f46e5, #1d4ed8);
    color: #ffffff;
    padding: 1% 5% 1% 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header__title {
    font-size: 18px;
    font-weight: 600;
}

.app-header__user {
    font-size: 13px;
    opacity: 0.9;
}

.app-header__logout {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    text-decoration: none;
    margin-left: 10px;
}

/* Page container – force full width */
.app-main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 18px 0 24px 0;
    padding: 0 5% 0 5%;
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.stat-card__label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

.stat-card__value {
    font-size: 20px;
    font-weight: 600;
    margin-top: 3px;
}

.stat-card__note {
    font-size: 11px;
    margin-top: 3px;
}

.stat-card--success {
    border-left: 4px solid #10b981;
}

.stat-card--warning {
    border-left: 4px solid #f59e0b;
}

.stat-card--danger {
    border-left: 4px solid #ef4444;
}

/* Filters */
.filters {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: flex-end;
    margin-top: 16px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

/* Table */
.table-wrapper {
    background: #ffffff;
    border-radius: 14px;
    margin-top: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead {
    background: #f9fafb;
}

.table th,
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.table tbody tr:nth-child(even) td {
    background: #f9fafb;
}

/* Make subject column wider on big screens */
.table th:nth-child(5),
.table td:nth-child(5) {
    width: 40%;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.badge--delivery {
    background: #dcfce7;
    color: #166534;
}

.badge--bounce {
    background: #fef3c7;
    color: #92400e;
}

.badge--complaint {
    background: #fee2e2;
    color: #b91c1c;
}

.badge--reject {
    background: #e5e7eb;
    color: #374151;
}

.badge--send {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Pagination */
.pagination {
    margin-top: 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination a,
.pagination span {
    margin-left: 2px;
    margin-right: 2px;
    padding: 4px 7px;
    border-radius: 999px;
    text-decoration: none;
}

.pagination span.current {
    background: #4f46e5;
    color: #ffffff;
}

.pagination a {
    background: #e5e7eb;
    color: #374151;
}

/* Small text */
.small-text {
    font-size: 11px;
    color: #6b7280;
}
