/* /Styles/declarations-styles.css */
.declarations {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    gap: 16px;
}

.declarations,
.declarations * {
    box-sizing: border-box;
}

.declarations .panel {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.declarations .panel > * + * {
    margin-top: 20px;
}

.declarations__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.declarations__titleWrap h1 {
    margin: 0;
}

.declarations__sub {
    margin-top: 4px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.62);
}

.declarations__headerActions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.declarations__state {
    padding: 10px 12px;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--rk-shadow-card);
    border-radius: 12px;
}

.declarations__state.is-error {
    background: #fee2e2;
    border-color: #fecaca;
    box-shadow: none;
    color: rgba(127, 29, 29, 1);
}

.decl-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.decl-summary__card {
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow: var(--rk-shadow-card);
    padding: 12px;
}

.decl-summary__label {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.62);
}

.decl-summary__value {
    margin-top: 6px;
    font-size: 1.25rem;
    font-weight: 700;
}

.decl-routes {
    padding: 12px;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--rk-shadow-card);
    border-radius: 14px;
}

.decl-routes__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.decl-routes__title {
    font-weight: 700;
}

.decl-routes__chips {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.decl-chip {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--color-white);
    border-radius: 999px;
    padding: 8px 10px;
    cursor: pointer;
    box-shadow: var(--rk-shadow-card);
    white-space: nowrap;
}

.decl-chip__name {
    font-size: 0.95rem;
    font-weight: 600;
}

.decl-routes__empty {
    margin-top: 10px;
    color: rgba(0, 0, 0, 0.62);
}

.decl-sectionTitle {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.decl-list {
    display: grid;
    gap: 10px;
}

.decl-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow: var(--rk-shadow-card);
    padding: 12px;
}

.decl-row__main {
    min-width: 0;
}

.decl-row__title {
    display: grid;
    gap: 4px;
    align-items: start;
}

.decl-row__date {
    font-weight: bold;
    font-size: 20px;
    color: rgba(15, 118, 110, 1);
}

.decl-row__route {
    font-weight: normal;
    color: rgba(15, 118, 110, 1);
}

.decl-row__arrow {
    margin: 0 4px;
    color: rgba(0, 0, 0, 0.55);
}

.decl-row__meta {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.95rem;
}

.decl-row__nums {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 10px;
    align-items: center;
    justify-items: center;
}

.decl-row__num {
    text-align: right;
}

.decl-row__numLabel {
    display: block;
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.62);
}

.decl-row__numVal {
    display: block;
    font-weight: bold;
    color: rgba(15, 118, 110, 1);
}

.decl-row__num--strong .decl-row__numVal {
    color: rgba(15, 118, 110, 1);
}

.decl-edit-btn{
    height: 24px;
}

.decl-row__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: -10px;
}

.decl-iconBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.decl-iconBtn--danger {
    color: #dc2626;
    height: 24px;
}

.decl-iconBtn:hover {
    background: transparent;
}

.decl-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 0;
    background: var(--color-primary, #1d4ed8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    z-index: 60;
    cursor: pointer;
}

.decl-fab svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.4;
    color: white;
}

.decl-fab:hover {
    filter: brightness(1.05);
}

@media (max-width: 600px) {
    .decl-fab {
        right: 16px;
        bottom: 16px;
    }
}

/* Filter panel (copy-ish from overview pages, but separate class to avoid side effects) */
.decl-filter {
    position: relative;
}

.decl-filter__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--color-white);
    border-radius: 14px;
    box-shadow: var(--rk-shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px;
    z-index: 20;
}

.decl-filter__panelHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.decl-filter__panelTitle {
    font-weight: 800;
}

.decl-filter__row {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.decl-filter__label {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.62);
}

.decl-filter__select {
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--color-white);
}

.decl-filter__actions {
    display: flex;
    justify-content: flex-end;
}

.decl-filter__close {
    display: flex;
    justify-content: center;
}

.decl-filter__closeBtn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.62);
    height: 24px;
}

/* Popup form */
.decl-form {
    display: grid;
    gap: 10px;
}

.decl-form__routeRow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
}

.decl-form__manageLink {
    justify-self: center;
    padding: 0;
    margin: 0;
    margin-top:-6px;
    border: 0;
    background: transparent;
    color: var(--btn-primary, #3B82F6);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    width: fit-content;
}

.decl-form__manageLink:hover {
    color: var(--btn-primary-hover, #2563EB);
}

.decl-select,
.decl-input {
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--color-white);
}

.decl-select--full {
    min-width: 0;
}

.decl-form__row {
    display: grid;
    gap: 6px;
}

.decl-form__label {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.62);
}

.decl-form__kmRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.decl-form__hint {
    font-size: 0.92rem;
    color: rgba(0, 0, 0, 0.62);
}

.decl-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

/* Routes manager popup */
.decl-routesMgr {
    position: relative;
    padding-bottom: 74px; /* space for popup FAB */
}

.decl-routesMgr__list {
    display: grid;
    gap: 10px;
}

.decl-routesMgr__empty {
    color: rgba(0, 0, 0, 0.62);
}

.decl-popupFab {
    position: absolute;
    right: 14px;
    bottom: 5px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 0;
    background: var(--color-primary, #1d4ed8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    color: white;
    cursor: pointer;
}

.decl-popupFab:hover {
    filter: brightness(1.05);
}

.decl-popupFab svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.4;
    color: white;
}

.decl-routeRow {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--color-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--rk-shadow-card);
}

.decl-routeRow__name {
    font-weight: 800;
}

.decl-routeRow__sub {
    margin-top: 2px;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.92rem;
}

.decl-routeRow__actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 700px) {
    .decl-row {
        grid-template-columns: 1fr;
    }
    .decl-row__nums {
        justify-content: start;
        grid-template-columns: repeat(3, 1fr);
    }
    .decl-summary {
        grid-template-columns: 1fr;
    }
    .decl-form__routeRow {
        grid-template-columns: 1fr;
    }
    .decl-form__kmRow {
        grid-template-columns: 1fr;
    }
}
