:root {
    --bg-1: #f7f3ea;
    --bg-2: #edf5f3;
    --surface: #ffffff;
    --text: #1d2939;
    --muted: #667085;
    --primary: #0b6b57;
    --primary-2: #1d9a7c;
    --danger: #d92d20;
    --danger-2: #b42318;
    --line: #d7e2dc;
    --shadow: rgba(19, 39, 54, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 28px;
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -10%, #fff1d4 0%, rgba(255, 241, 212, 0) 40%),
        radial-gradient(circle at 110% 10%, #d8f0ea 0%, rgba(216, 240, 234, 0) 42%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.app-shell {
    padding-bottom: 24px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(23, 44, 59, 0.12);
}

.auth-form {
    margin-top: 20px;
}

.auth-hint {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.hero {
    background:
        linear-gradient(140deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)),
        linear-gradient(130deg, #0a5948, #188368 55%, #1f9a7b);
    color: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(10, 67, 53, 0.24);
}

.hero-wide {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kicker {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.9;
}

h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
}

.subtitle {
    margin: 10px 0 0;
    opacity: 0.95;
    max-width: 720px;
}

.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 16px 36px var(--shadow);
}

h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

h3 {
    margin: 0 0 8px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.section-kicker {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.contact-form,
.filters-form {
    display: grid;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: var(--text);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 4px rgba(29, 154, 124, 0.14);
}

button {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(11, 107, 87, 0.22);
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-row input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e6ebf3;
    vertical-align: top;
}

table th {
    background: #f3faf7;
    color: #375565;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.delete-btn {
    display: inline-block;
    color: #fff;
    background: var(--danger);
    padding: 7px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.delete-btn:hover {
    background: var(--danger-2);
}

.edit-btn {
    display: inline-block;
    color: #fff;
    background: #176948;
    padding: 7px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.edit-btn:hover {
    background: #0f5135;
}

.ghost-btn {
    display: inline-block;
    color: #334155;
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.ghost-btn:hover {
    background: #f8fafc;
}

.ghost-btn-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.ghost-btn-light:hover {
    background: rgba(255, 255, 255, 0.18);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flash {
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 600;
}

.flash-success {
    background: #e8f8f1;
    color: #16614d;
    border: 1px solid #b9e8d5;
}

.flash-error {
    background: #fff0ee;
    color: #9c2b20;
    border: 1px solid #f5c6bf;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 30px var(--shadow);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.results-pill {
    background: #eef7f2;
    color: var(--primary);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
}

.favorite-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #fff7e1;
    color: #8b6a16;
    text-decoration: none;
    font-size: 22px;
}

.favorite-toggle.is-active {
    background: #ffe6a7;
    color: #9c6d00;
}

.contact-main {
    display: grid;
    gap: 6px;
}

.contact-main strong {
    font-size: 16px;
}

.contact-main span {
    color: var(--muted);
    font-size: 14px;
}

.compact span {
    color: #475467;
}

.category-badge {
    display: inline-block;
    background: #ebf8f2;
    color: var(--primary);
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.note-cell {
    max-width: 260px;
    color: #475467;
}

.empty-state {
    padding: 20px 6px 6px;
    text-align: center;
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .hero {
        padding: 20px;
    }

    .hero-wide,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    h1 {
        font-size: 28px;
    }

    .grid-3,
    .grid-4,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
