* { box-sizing: border-box; }

body {
    font-family: Tahoma, "Segoe UI", sans-serif;
    background: #f4f5f7;
    color: #1f2430;
    margin: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border: 1px solid #dfe2e8;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    min-width: 320px;
}

.login-card h1 {
    margin-top: 0;
    font-size: 22px;
}

.error-text {
    color: #c0392b;
    margin-top: 12px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dfe2e8;
    padding: 12px 20px;
}

.topbar button {
    margin-right: 12px;
    padding: 6px 14px;
    border: 1px solid #c7cbd4;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.content {
    padding: 20px;
}

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

table th, table td {
    border: 1px solid #dfe2e8;
    padding: 8px 10px;
    text-align: right;
}

.badge-active { color: #1a7f37; font-weight: bold; }
.badge-disabled { color: #c0392b; font-weight: bold; }
.badge-expired { color: #8a6d3b; font-weight: bold; }

.tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    border-bottom: 1px solid #dfe2e8;
    padding: 0 20px;
}

.tab-btn {
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
}

.tab-btn.active {
    border-bottom-color: #2f6fed;
    font-weight: bold;
}

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

.stat-tile {
    background: #fff;
    border: 1px solid #dfe2e8;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    background: #fff;
    padding: 12px;
    border: 1px solid #dfe2e8;
    border-radius: 8px;
}

.inline-form input[type="text"],
.inline-form input[type="number"] {
    padding: 6px 8px;
    border: 1px solid #c7cbd4;
    border-radius: 4px;
    width: 140px;
}

.inline-form button {
    padding: 7px 16px;
    border: none;
    background: #2f6fed;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

table button {
    padding: 4px 10px;
    border: 1px solid #c7cbd4;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 4px;
}

.action-bar {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.action-bar button {
    padding: 8px 18px;
    border: none;
    background: #2f6fed;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

table code {
    font-size: 11px;
    word-break: break-all;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    min-width: 340px;
    max-width: 90vw;
}

.modal-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-box label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.modal-box input, .modal-box select {
    padding: 7px 8px;
    border: 1px solid #c7cbd4;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.modal-actions button[type="submit"] {
    background: #2f6fed;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-actions button[type="button"] {
    background: #fff;
    border: 1px solid #c7cbd4;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
}

.hint-text {
    color: #666;
    font-size: 13px;
    margin: -6px 0 6px;
}
