:root {
    --bg: #f4f8fc;
    --card: #ffffff;
    --text: #1f2a3a;
    --muted: #64748b;
    --line: #d7e3f1;
    --primary: #2b6cb0;
    --primary-hover: #21568d;
    --secondary: #e6eef8;
    --ok: #24a148;
    --warn: #d6a700;
    --alert: #d92d20;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card,
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 22px rgba(36, 83, 126, 0.06);
}

.header {
    background: #e7f1ff;
    border: 1px solid #c7dcf8;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

h1, h2 {
    margin: 0;
}

.subtitle,
.hint,
.header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.menu {
    display: flex;
    gap: 12px;
}

.menu a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.form-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.form-inline {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

input, select, textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 5px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

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

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

.table-wrap {
    margin-top: 14px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

tbody tr.clickable {
    cursor: pointer;
}

tbody tr.clickable:hover {
    background: #f1f7ff;
}

.sla-ok { border-left: 4px solid var(--ok); }
.sla-warn { border-left: 4px solid var(--warn); }
.sla-alert { border-left: 4px solid var(--alert); }

.history {
    margin: 10px 0;
    padding-left: 20px;
}

.details-empty {
    color: var(--muted);
}

.hidden {
    display: none;
}

.push-btn {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 1001;
    background: #2b6cb0;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
}

.toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
    z-index: 999;
}

.toast {
    background: #1f3f61;
    color: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 240px;
}

.pwa-hint {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    background: #1f3f61;
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    z-index: 1000;
    font-size: 13px;
}

.pwa-hint button {
    margin-left: 8px;
    background: #e6eef8;
    color: #1f3f61;
    border: 0;
    border-radius: 6px;
    padding: 5px 8px;
}

@media (max-width: 768px) {
    .page {
        padding: 12px;
    }

    .header {
        padding: 14px;
    }
}
