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

:root {
    --primary: #1a1a2e;
    --accent: #0f3460;
    --highlight: #e94560;
    --bg: #f5f6fa;
    --text: #2d3436;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 0 2rem;
    height: 60px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--white);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.logo-badge {
    font-size: 0.65rem;
    background: var(--highlight);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
}

.nav-user {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.logout-form {
    display: inline;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: #636e72;
}

/* Feature Grid */
.features {
    padding: 1rem 0 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.feature-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p {
    color: #636e72;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.6);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.85rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.footer a:hover {
    color: var(--white);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    color: var(--primary);
    font-size: 2rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: #636e72;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-error {
    background: #ffe0e0;
    color: #c0392b;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Email Page */
.email-page h1 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.email-filters {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-search {
    flex: 1;
    min-width: 200px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #636e72;
    white-space: nowrap;
}

.filter-date {
    width: 160px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary);
}

.btn-secondary {
    background: #ddd;
    color: var(--text);
}

.btn-secondary:hover {
    background: #ccc;
}

.results-info {
    font-size: 0.85rem;
    color: #636e72;
    margin-bottom: 0.75rem;
}

.table-wrapper {
    overflow-x: auto;
}

.email-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.email-table thead {
    background: var(--primary);
    color: var(--white);
}

.email-table th,
.email-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
}

.email-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.email-table tbody tr:hover {
    background: #f8f9fa;
}

.col-subject {
    max-width: 400px;
}

.col-sender {
    white-space: nowrap;
}

.col-date {
    white-space: nowrap;
    color: #636e72;
}

.col-attach {
    white-space: nowrap;
    color: #636e72;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #636e72;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.page-link {
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid #ddd;
}

.page-link:hover {
    background: #f0f0f0;
}

.page-link.current {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.page-link.dots {
    border: none;
}
