* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Segoe UI", sans-serif;
    background: #f1f5f9;
    color: #111827;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #bfdbfe;
    border-radius: 28px;
    padding: 34px 28px;
    box-shadow: 0 16px 40px rgba(30, 64, 175, 0.12);
    text-align: center;
}

.login-card h1 {
    margin: 0 0 8px;
    color: #1d4ed8;
    font-size: 32px;
}

.subtitle {
    margin: 0 0 26px;
    color: #64748b;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form input {
    height: 54px;
    border-radius: 16px;
    border: 1px solid #bfdbfe;
    padding: 0 16px;
    font-size: 15px;
}

.login-form button {
    height: 54px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 16px;
}

.hero {
    background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
    color: #fff;
    border-radius: 18px;
    padding: 20px 22px;
    margin-bottom: 12px;
}

.hero h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.hero p {
    margin: 0;
    color: #dbeafe;
}

.panel {
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    margin-bottom: 12px;
}

.controls {
    padding: 16px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.field input,
.field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    font-size: 14px;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: #3b82f6;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 120px;
    border-radius: 10px;
    border: none;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    padding: 0 16px;
    cursor: pointer;
}

.btn-primary { background: #2563eb; }
.btn-success { background: #059669; }
.btn-danger { background: #dc2626; }

#message {
    margin-top: 12px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.table-panel {
    overflow: hidden;
}

.table-topbar {
    padding: 14px 16px 0;
    display: flex;
    justify-content: flex-end;
    font-weight: 700;
    color: #1e3a8a;
}

.table-wrap {
    overflow: auto;
    padding: 12px 16px 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    font-size: 13px;
}

thead th {
    background: #eaf2ff;
    color: #1e3a8a;
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #dbeafe;
    position: sticky;
    top: 0;
}

tbody td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

tbody tr:nth-child(even) {
    background: #f8fafc;
}

.link-btn {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.copy-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.2);
    display: grid;
    place-items: center;
    z-index: 9999;
}

.loading-card {
    width: 220px;
    height: 170px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(191, 219, 254, 1);
    border-radius: 24px;
    display: grid;
    place-items: center;
    gap: 12px;
    color: #1e3a8a;
    font-weight: 800;
}

.spinner {
    width: 46px;
    height: 46px;
    border: 5px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none;
}

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

@media (max-width: 1100px) {
    .field-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

.btn-secondary {
    background: #7c3aed;
}

.dev-footer,
.main-footer {
    text-align: center;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.dev-footer {
    margin-top: 18px;
}

.main-footer {
    padding: 4px 0 18px;
}
