:root {
    --accent: #4d9fff;
    --accent-dark: #2f7fe0;
    --bg: #0d0d0f;
    --card: #131316;
    --card-2: #1a1a1e;
    --border: #2c2c31;
    --text: #e8e8ea;
    --muted: #9a9aa2;
    --error: #ff6b6b;
    --ok-bg: #15301c;
    --ok-border: #3fae4f;
    --err-bg: #3a1518;
    --err-border: #e5534b;
    --warn: #e0b23c;
}

* { box-sizing: border-box; }

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

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

header h1 {
    font-size: 26px;
    margin-bottom: 6px;
    color: var(--text);
}

.lead {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 28px;
}

.btn-link {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.btn-link:hover {
    background: var(--accent);
    color: #0a0a0c;
}

form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 24px 24px;
}

section {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
section:last-of-type {
    border-bottom: none;
}

section h2 {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 14px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.field-narrow {
    max-width: 220px;
}

label {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #c6c6cc;
}

input, textarea {
    font-size: 14.5px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    background: #0a0a0c;
    color: var(--text);
}

input::placeholder, textarea::placeholder {
    color: var(--muted);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #161619;
}

textarea { resize: vertical; }

.error {
    color: var(--error);
    font-size: 12.5px;
    min-height: 16px;
    margin-top: 3px;
}

button[type="submit"] {
    margin-top: 20px;
    width: 100%;
    padding: 13px 18px;
    background: var(--accent);
    color: #0a0a0c;
    font-size: 15.5px;
    font-weight: 700;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s ease;
}
button[type="submit"]:hover { background: var(--accent-dark); }
button[type="submit"]:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.result {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    line-height: 1.55;
}
.result.hidden { display: none; }
.result.ok {
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
}
.result.error {
    background: var(--err-bg);
    border: 1px solid var(--err-border);
}
.result a {
    color: var(--accent);
    font-weight: 600;
}
.result .warn-line {
    color: var(--warn);
    margin-top: 6px;
}

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

/* --- admin sąrašo puslapis --- */
table.contracts {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
table.contracts th, table.contracts td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    text-align: left;
    color: var(--text);
}
table.contracts th {
    background: #1c1c20;
    color: #c6c6cc;
}
table.contracts tbody tr:hover {
    background: var(--card-2);
}
table.contracts a {
    color: var(--accent);
    text-decoration: none;
}
table.contracts a:hover {
    text-decoration: underline;
}
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
}
.badge.issiusta { background: #2e7d32; }
.badge.sukurta { background: #b8860b; }
.badge.klaida { background: #c62828; }
.badge.nepristatyta { background: #ad1457; }
.status-badge { white-space: nowrap; cursor: default; }

#bounce-check-result {
    font-size: 13px;
    margin-left: 10px;
}

.error-detail {
    font-size: 11.5px;
    color: var(--error);
    margin-top: 4px;
    max-width: 260px;
    white-space: normal;
    line-height: 1.35;
}

.list-link-btn {
    display: block;
    text-align: center;
    margin-top: 28px;
    padding: 13px 18px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    border-radius: 9px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.list-link-btn:hover {
    background: var(--accent);
    color: #0a0a0c;
}

.wrap-wide { max-width: 1240px; }

table.contracts td.nowrap,
table.contracts th.nowrap {
    white-space: nowrap;
}

.paid-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.paid-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.paid-label {
    font-size: 12.5px;
    font-weight: 600;
}
.paid-label.paid { color: #5fd775; }
.paid-label.unpaid { color: var(--error); }

.small-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #1c1c20;
    color: var(--text);
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.small-btn:hover { background: #26262b; border-color: var(--accent); }
.small-btn:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 720px) {
    table.contracts { display: block; overflow-x: auto; white-space: nowrap; }
}

/* --- prisijungimo (/login) puslapis --- */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrap {
    max-width: 400px;
    width: 100%;
}
.login-wrap h1 {
    text-align: center;
}
.login-form { margin-top: 4px; }
.login-wrap label {
    display: block;
    margin-bottom: 16px;
    text-align: left;
}
.login-wrap label input {
    display: block;
    width: 100%;
    margin-top: 6px;
}

.header-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.header-top h1 { margin: 0; }

.logout-form {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}
button.logout-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin-top: 0;
    padding: 7px 16px;
    background: #1c1c20;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
button.logout-link:hover {
    background: var(--err-bg);
    border-color: var(--error);
    color: var(--error);
}
