* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f5f7;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

nav {
    display: flex;
    gap: 20px;
    background: #1e1e2e;
    padding: 14px 24px;
    margin: 0 0 24px 0;
    width: 100%;
}

nav a {
    color: #cfd2da;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

nav a:hover, nav a.active {
    color: #ffffff;
}

h1 { font-size: 24px; margin-bottom: 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; color: #333; }

.error {
    background: #fde8e8;
    color: #c53030;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.success {
    background: #e6f9ee;
    color: #1a7a45;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

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

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin: 12px 0 4px;
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5d8dd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
}

button, .btn-cancel {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 14px;
    display: inline-block;
    text-decoration: none;
}

button:hover, .btn-cancel:hover { background: #4338ca; }

.btn-cancel { background: #6b7280; }
.btn-cancel:hover { background: #4b5563; }

.filters {
    margin-bottom: 16px;
    font-size: 14px;
}

.filters a {
    color: #4f46e5;
    text-decoration: none;
    margin-right: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

th {
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

tr:last-child td { border-bottom: none; }

.badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-unused { background: #e0e7ff; color: #4338ca; }
.badge-used { background: #d1fae5; color: #065f46; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-sent { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fde8e8; color: #c53030; }

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.actions a {
    color: #4f46e5;
    text-decoration: none;
    font-size: 13px;
}

.actions a:hover { text-decoration: underline; }

.link-btn {
    background: #4f46e5;
    border: none;
    color: #fff !important;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 18px;;
    margin: 0;
    font-weight: 500;
    text-decoration: none;
    font-family: inherit;
}

.send-btn { color: #059669; }
.send-btn:hover { text-decoration: underline; }

.delete-btn { color: #c53030; }
.delete-btn:hover { text-decoration: underline; }

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-grid .card h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: #888;
    margin: 0 0 8px 0;
}

.dashboard-grid .card p {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.login-container {
    max-width: 380px;
    margin: 80px auto;
}

.login-container form {
    padding: 32px;
}

.login-container h1 {
    text-align: center;
}

code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}