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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

nav {
    background: #1a1a2e;
    color: #fff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.nav-links { display: flex; gap: 0.25rem; }

.nav-links a {
    color: #aaa;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.15); }

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eee;
}

th {
    background: #f9f9f9;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover { background: #f7f7ff; }

.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3a56d4; }
.btn-danger { background: #e63946; color: #fff; }
.btn-danger:hover { background: #c5303c; }
.btn-success { background: #2a9d8f; color: #fff; }
.btn-success:hover { background: #248a7e; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}

.pagination a { background: #e8e8e8; color: #333; }
.pagination a:hover { background: #d0d0d0; }
.pagination .current { background: #4361ee; color: #fff; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sent { background: #d4edda; color: #155724; }
.badge-draft { background: #fff3cd; color: #856404; }
.badge-default { background: #e2e3e5; color: #383d41; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4361ee;
}

.stat-card .label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.msg {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.msg-success { background: #d4edda; color: #155724; }
.msg-error { background: #f8d7da; color: #721c24; }

.loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.loading.show { display: inline-flex; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.select-all-wrap { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }

.empty { text-align: center; padding: 3rem; color: #999; }
