:root {
    --bg1: #f8fbff;
    --bg2: #eef8ff;
    --panel: #ffffff;
    --text: #10233f;
    --muted: #5e6b7d;
    --border: #d7e4f3;
    --shadow: 0 16px 40px rgba(16, 35, 63, .10);
    --accent: #1fbfb8;
    --accent2: #0ea5e9;
    --radius: 20px;
    --pill: 999px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, var(--bg2), var(--bg1) 45%, #dff6f5 100%);
    color: var(--text);
    padding: 26px 14px
}

.app {
    max-width: 1380px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(246, 253, 255, .96));
    border: 1px solid rgba(167, 186, 208, .4);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(circle at top left, rgba(31, 191, 184, .12), transparent 60%)
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand h1 {
    margin: 0;
    font-size: 20px
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.btn {
    border: 0;
    border-radius: var(--pill);
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap
}

.btn:hover {
    transform: translateY(-1px)
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #062a2a;
    font-weight: 700
}

.btn-outline {
    background: #fff;
    border: 1px solid #c8d7e6;
    color: var(--text)
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted)
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #cbd8e5;
    background: #f8fbfe;
    border-radius: var(--pill);
    padding: 5px 10px;
    font-size: 11px;
    color: var(--muted)
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2)
}

.grid {
    display: grid;
    grid-template-columns: 1.15fr 1.85fr;
    gap: 16px;
    padding: 16px
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(16, 35, 63, .08);
    padding: 16px;
    overflow: hidden
}

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

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px
}

.title-sm {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase
}

.sub {
    font-size: 12px;
    color: var(--muted)
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px
}

.stat {
    border: 1px solid rgba(130, 153, 180, .28);
    border-radius: 16px;
    padding: 10px;
    background: linear-gradient(180deg, #fff, #f8fcff);
    cursor: pointer
}

.stat-urgent {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fef2f2, #fee2e2)
}

.label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em
}

.label-urgent {
    color: #b91c1c
}

.value {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 6px
}

.mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--pill);
    border: 1px solid rgba(130, 153, 180, .25);
    font-size: 11px;
    color: var(--muted);
    background: #fff
}

.mini-urgent {
    border-color: #f97373;
    background: #fee2e2;
    color: #b91c1c
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px
}

.filters input,
.filters select,
.field {
    width: 100%;
    background: #fff;
    border: 1px solid #cfddeb;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text);
    outline: none
}

.filters input,
.filters select {
    width: auto;
    min-width: 0;
    border-radius: var(--pill)
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    max-height: 470px
}

.table-wrap::-webkit-scrollbar {
    height: 10px;
    width: 10px
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #c5d7e8;
    border-radius: 20px
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px
}

thead {
    background: #edf5fb;
    position: sticky;
    top: 0;
    z-index: 3
}

th,
td {
    padding: 8px 9px;
    border-bottom: 1px solid #edf2f7;
    white-space: nowrap;
    text-align: left
}

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted)
}

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

tbody tr:hover {
    background: #eef7ff
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--pill);
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid transparent
}

.b-green {
    background: rgba(34, 197, 94, .12);
    color: #166534;
    border-color: rgba(34, 197, 94, .3)
}

.b-amber {
    background: rgba(245, 158, 11, .12);
    color: #92400e;
    border-color: rgba(245, 158, 11, .3)
}

.b-red {
    background: rgba(248, 113, 113, .12);
    color: #991b1b;
    border-color: rgba(248, 113, 113, .3)
}

.b-blue {
    background: rgba(59, 130, 246, .12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, .3)
}

.btn-t {
    border-radius: var(--pill);
    padding: 4px 8px;
    border: 1px solid #cbd8e5;
    background: #fff;
    font-size: 11px;
    cursor: pointer
}

.btn-t.green {
    border-color: #22c55e;
    color: #166534
}

.btn-t.red {
    border-color: #f87171;
    color: #991b1b
}

.btn-t.blue {
    border-color: #60a5fa;
    color: #1d4ed8
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px
}

.small {
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 4px
}

.date-note {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px
}

.section {
    margin-top: 12px
}

.section h3 {
    margin: 0 0 4px;
    font-size: 13px
}

.section p {
    margin: 0;
    color: var(--muted);
    font-size: 12px
}

.calendar-box {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfeff;
    overflow: hidden
}

.calendar-box h3 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px
}

.calendar-box .inner {
    max-height: 320px;
    overflow: auto
}

.calendar-box .item {
    display: grid;
    grid-template-columns: 1.4fr .8fr .8fr .8fr;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f7;
    font-size: 12px
}

.calendar-box .item:nth-child(even) {
    background: #fff
}

.calendar-box .head {
    position: sticky;
    top: 0;
    background: #eaf6ff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700
}

.settings {
    position: relative
}

.settings-panel {
    position: absolute;
    right: 0;
    top: 46px;
    width: 240px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(16, 35, 63, .12);
    border-radius: 18px;
    padding: 12px;
    display: none;
    z-index: 40
}

.settings-panel.open {
    display: block
}

.swatches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px
}

.swatch {
    height: 32px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .06);
    cursor: pointer
}

.swatch.pink {
    background: linear-gradient(135deg, #ffd1dc, #ff7aa2)
}

.swatch.green {
    background: linear-gradient(135deg, #d1fae5, #34d399)
}

.swatch.blue {
    background: linear-gradient(135deg, #dbeafe, #60a5fa)
}

.swatch.purple {
    background: linear-gradient(135deg, #ede9fe, #a78bfa)
}

.swatch.yellow {
    background: linear-gradient(135deg, #fef3c7, #f59e0b)
}

.empty {
    padding: 12px;
    color: var(--muted);
    font-size: 12px;
    text-align: center
}