* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f6f8;
    color: #1f2328;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    width: 320px;
}
.login-box h1 {
    font-size: 18px;
    margin: 0 0 20px;
    text-align: center;
}
.login-box label {
    display: block;
    font-size: 13px;
    color: #57606a;
    margin-bottom: 14px;
}
.login-box input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.login-box .error {
    color: #cf222e;
    font-size: 13px;
    margin-bottom: 14px;
}

/* App shell */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 14px 24px;
    border-bottom: 1px solid #e1e4e8;
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar-right { font-size: 13px; color: #57606a; display: flex; gap: 12px; align-items: center; }
.topbar-right a { color: #1f6feb; text-decoration: none; }

.partner-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px 0;
    flex-wrap: wrap;
}
.partner-tab {
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    background: #eaecef;
    color: #1f2328;
    text-decoration: none;
    font-size: 13px;
}
.partner-tab.active {
    background: #fff;
    font-weight: 600;
    box-shadow: 0 -1px 0 #1f6feb inset;
}

/* Unanswered auto-confirmation reminders, shown as rows inside the main table */
.overdue-count { color: #cf222e; font-weight: 600; }
table.messages tr.row-overdue {
    background: #fff5f5;
}
table.messages tr.row-overdue td {
    color: #cf222e;
    font-weight: 600;
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 16px 24px 0;
}
.search-bar input[type=text] {
    flex: 1;
    max-width: 320px;
    padding: 8px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
}
.search-bar button {
    padding: 8px 16px;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.clear-search { font-size: 13px; color: #57606a; }

.result-count {
    padding: 10px 24px 0;
    font-size: 13px;
    color: #57606a;
}

table.messages {
    width: calc(100% - 48px);
    margin: 12px 24px 24px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
table.messages th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #57606a;
    background: #f6f8fa;
    padding: 10px 14px;
    border-bottom: 1px solid #e1e4e8;
}
table.messages td {
    padding: 10px 14px;
    border-bottom: 1px solid #eef0f2;
    font-size: 14px;
    vertical-align: top;
}
table.messages td.nowrap { white-space: nowrap; }
table.messages tr.row-button td:last-child { color: #8250df; }
table.messages td.empty { text-align: center; color: #8c959f; padding: 32px; }

.pagination {
    display: flex;
    gap: 6px;
    padding: 0 24px 24px;
}
.pagination a {
    padding: 6px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d0d7de;
    color: #1f2328;
    text-decoration: none;
    font-size: 13px;
}
.pagination a.active {
    background: #1f6feb;
    color: #fff;
    border-color: #1f6feb;
}

@media (max-width: 480px) {
    table.messages { width: calc(100% - 24px); margin-left: 12px; margin-right: 12px; }
    .topbar, .partner-tabs, .search-bar, .result-count, .pagination { padding-left: 12px; padding-right: 12px; }
}
