/* static/styles.css - compact layout, mainly used on a phone */

:root {
    --green: #2f6f4f;
    --green-soft: #e8f3ec;
    --on: #1e9e55;
    --text: #1f2933;
    --muted: #6b7785;
    --line: #e3e7eb;
    --bg: #f3f5f7;
    --radius: 10px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 560px;
    padding-left: 12px;
    padding-right: 12px;
}

/* --- Top bar --- */

.topbar {
    background-color: var(--green);
    color: #fff;
    margin-bottom: 12px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 48px;
}

.brand {
    font-size: 17px;
    font-weight: 600;
    margin-right: auto;
}

.topnav a,
.logout {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    padding: 6px 9px;
    border-radius: 6px;
}

.topnav a.active,
.topnav a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.16);
    text-decoration: none;
}

.logout {
    background: none;
    border: 0;
}

.logout:hover {
    color: #fff;
}

/* --- Cards and rows --- */

.card-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.card-box.list {
    list-style: none;
    padding: 0 12px;
}

.card-box.list > li {
    border-top: 1px solid var(--line);
    padding: 8px 0;
}

.card-box.list > li:first-child {
    border-top: 0;
}

.row-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 2px 6px;
}

.muted-small {
    font-size: 13px;
    color: var(--muted);
}

.flash {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    font-size: 14px;
}

/* Keep buttons big enough to tap */
.btn-sm {
    min-height: 34px;
    padding: 4px 12px;
    border-radius: 6px;
}

/* --- Status --- */

.status-title {
    font-weight: 600;
}

.status-sub {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.status-sub:hover {
    color: var(--green);
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: 1px;
}

.status-on .dot { background-color: var(--on); }
.status-off .dot { background-color: #d64545; }

.status-off {
    border-color: #f1c4c4;
    background: #fdf5f5;
}

/* --- Zones --- */

.zone-name {
    font-weight: 600;
    margin-right: 6px;
}

.pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    vertical-align: 1px;
}

.pill-on {
    background: var(--on);
    color: #fff;
}

.pill-off {
    background: #eef0f2;
    color: var(--muted);
}

.zone-btn {
    min-width: 84px;
}

/* --- Run a zone --- */

/* Zone on its own row so the chosen name always has room; controls grow with the text size */
.run-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.run-form .custom-select {
    grid-column: 1 / -1;
}

.run-form .custom-select,
.run-form .duration,
.sched-fields .custom-select,
.sched-fields .form-control {
    height: auto;
    min-height: 36px;
    font-size: 15px;
}

.run-form .btn {
    min-width: 84px;
}

/* --- Activity log --- */

.log > li {
    display: flex;
    gap: 12px;
    font-size: 13px;
    padding: 5px 0 !important;
}

.log-when {
    flex: 0 0 auto;
    min-width: 88px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.log-text {
    min-width: 0;
}

/* --- Schedule --- */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.section-head .section-title {
    margin-bottom: 0;
}

.segmented {
    display: inline-flex;
    background: #e6eaee;
    border-radius: 8px;
    padding: 2px;
}

.segmented a {
    font-size: 13px;
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 6px;
}

.segmented a:hover {
    text-decoration: none;
    color: var(--text);
}

.segmented a.active {
    background: #fff;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.group-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 2px 6px;
}

.sched summary,
.sched-add summary {
    cursor: pointer;
    list-style: none;
}

.sched summary::-webkit-details-marker,
.sched-add summary::-webkit-details-marker {
    display: none;
}

.sched-paused summary {
    opacity: 0.55;
}

.sched-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 6px;
}

.sched-meta {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.sched-next {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.sched-add summary {
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
}

.sched-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.sched-actions {
    gap: 8px;
}

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

/* --- Login --- */

.login {
    padding: 16px;
}

.login-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* --- Users --- */

.invite-new {
    border-color: #9fd3b4;
    background: var(--green-soft);
}

.invite-new input[readonly] {
    background: #fff;
    font-size: 13px;
}
