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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    background: #f4f5f7;
    color: #24292e;
}

/* ── LOGIN ── */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 40px;
    width: 340px;
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #24292e;
    letter-spacing: .05em;
}

.login-sub {
    font-size: 12px;
    color: #586069;
    text-align: center;
    margin-bottom: 28px;
    margin-top: 4px;
}

.alert {
    background: #ffeef0;
    border: 1px solid #ffdce0;
    color: #86181d;
    padding: 10px 14px;
    border-radius: 5px;
    margin-bottom: 16px;
    font-size: 13px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: #444d56;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}

.form-group input:focus {
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3,102,214,.15);
}

.btn-primary {
    width: 100%;
    padding: 9px;
    background: #0366d6;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}

.btn-primary:hover { background: #0256b4; }

/* ── HEADER ── */
header {
    background: #fff;
    border-bottom: 1px solid #e1e4e8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .04em;
}

.site-sub {
    font-weight: 400;
    font-size: 12px;
    color: #586069;
    margin-left: 8px;
    letter-spacing: 0;
}

.logout-link {
    font-size: 13px;
    color: #586069;
    text-decoration: none;
}

.logout-link:hover { color: #0366d6; }

/* ── MAIN ── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* ── STATS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px 24px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #0366d6;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    color: #586069;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── TABLE ── */
.table-section {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
}

.table-header h2 {
    font-size: 15px;
    font-weight: 600;
}

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

thead th {
    background: #f6f8fa;
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #586069;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e1e4e8;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f6f8fa; }

tbody td { padding: 10px 16px; vertical-align: middle; }

.td-date, .td-time { color: #586069; font-size: 12px; white-space: nowrap; font-family: monospace; }
.td-numero { font-family: monospace; font-size: 13px; font-weight: 500; }
.td-message { max-width: 360px; color: #444d56; }
.td-issue { max-width: 180px; }

.issue-link {
    color: #0366d6;
    text-decoration: none;
    font-size: 12px;
    font-family: monospace;
}

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

.muted { color: #959da5; }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge-in   { background: #dcfce7; color: #166534; }
.badge-out  { background: #dbeafe; color: #1e40af; }

.badge-type-sms { background: #f3f4f6; color: #374151; }
.badge-type-mms { background: #fef3c7; color: #92400e; }
.badge-type-rcs { background: #ede9fe; color: #5b21b6; }

/* ── EMPTY ── */
.empty-state {
    padding: 48px;
    text-align: center;
    color: #586069;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .td-time, .td-issue { display: none; }
}
