* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #0f172a;
    color: #f8fafc;
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: min(1000px, 94vw);
    margin: 32px auto;
}

.topbar,
.section-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.section-title-row {
    margin-bottom: 18px;
}

h1 {
    margin: 0;
    font-size: 34px;
}

h2 {
    margin-top: 0;
}

h3 {
    margin-bottom: 6px;
}

p,
li {
    color: #cbd5e1;
    line-height: 1.45;
}

.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
}

.main-action {
    text-align: center;
    padding: 42px 24px;
}

button,
.nav a,
.nav-button,
.small-button {
    border: 0;
    border-radius: 14px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.nav,
.button-row {
    display: flex;
    gap: 12px;
}

.nav a,
.nav-button,
.small-button {
    background: #38bdf8;
    color: #082f49;
}

.small-button.secondary {
    background: #64748b;
    color: #f8fafc;
}

.start-button {
    background: #22c55e;
    color: #052e16;
    font-size: 22px;
    padding: 20px 32px;
}

.end-button {
    background: #fb7185;
    color: #450a0a;
    font-size: 22px;
    padding: 20px 32px;
}

.delete-button {
    background: #ef4444;
    color: white;
}

.success {
    background: #14532d;
    border-color: #22c55e;
}

.error {
    background: #450a0a;
    border-color: #ef4444;
}

.warning-card {
    background: #422006;
    border-color: #f59e0b;
}

.info-card {
    background: #0c4a6e;
    border-color: #38bdf8;
}

.muted {
    color: #94a3b8;
}

.active-text {
    color: #4ade80;
    font-weight: 700;
}

.workday-row,
.parking-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #334155;
}

.workday-row:last-child,
.parking-row:last-child {
    border-bottom: 0;
}

.sub-list {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #0f172a;
    color: #cbd5e1;
}

.map-placeholder {
    min-height: 260px;
    border-radius: 14px;
    border: 2px dashed #64748b;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 30px;
    margin-bottom: 20px;
}

#map {
    width: 100%;
    height: 520px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #334155;
    color: #f8fafc;
    font-size: 13px;
    vertical-align: middle;
}

.rule-block {
    padding: 18px 0;
    border-bottom: 1px solid #334155;
}

.rule-block:last-child {
    border-bottom: 0;
}

.rule-time {
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
}

.bottom-link {
    margin-top: 24px;
}

@media (max-width: 700px) {
    .topbar,
    .section-title-row,
    .workday-row,
    .parking-row {
        display: block;
    }

    .nav,
    .button-row {
        display: block;
    }

    .nav a,
    .nav-button,
    .small-button,
    button {
        width: 100%;
        text-align: center;
        margin-top: 14px;
    }
}


.lot-images {
    display: grid;
    gap: 20px;
}

.lot-images img {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #334155;
    background: white;
}


.inline-form {
    margin: 0;
}

.small-start {
    font-size: 16px;
    padding: 14px 22px;
}

.lot-header .section-title-row {
    align-items: flex-start;
}


.image-card {
    border-color: #64748b;
}

.lot-images {
    display: grid;
    gap: 20px;
}

.lot-images img {
    width: 100%;
    display: block;
    border-radius: 14px;
    border: 1px solid #334155;
    background: white;
}


.lot-images img {
    width: 100%;
    display: block;
    border-radius: 14px;
    border: 1px solid #334155;
}


/* Main navigation buttons */
.nav a {
    background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    border: 1px solid #3b82f6;
    font-size: 17px;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transition: all .18s ease;
}

.nav a:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 10px 22px rgba(59, 130, 246, 0.45);
}

/* Keep utility buttons lighter */
.small-button {
    background: #38bdf8;
    color: #082f49;
}

.small-button.secondary {
    background: #64748b;
    color: white;
}


.fine-button {
    background: #f59e0b;
    color: #422006;
}

.fine-form {
    margin-top: 20px;
}


.control-state {
    display: flex;
    gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #334155;
}

.control-state > div {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 170px;
}

.state-label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 6px;
}

.control-timeline {
    margin-top: 16px;
    padding: 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #1e293b;
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-item.fine {
    color: #fbbf24;
}

.timeline-time {
    min-width: 70px;
    color: #cbd5e1;
    font-weight: 700;
}

@media (max-width: 700px) {
    .control-state {
        display: block;
    }

    .control-state > div {
        margin-bottom: 12px;
    }
}


.last-control-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 12px 16px;
    min-width: 170px;
}

.last-control-box span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 5px;
}

.parking-control-list {
    display: grid;
    gap: 12px;
}

.parking-control-row {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 16px;
}

.parking-control-row.own-control {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .25);
}

.own-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #22c55e;
    color: #052e16;
    font-size: 12px;
    font-weight: 800;
}

.mini-timeline {
    margin-top: 10px;
    padding: 10px;
    background: #1e293b;
    border-radius: 10px;
    color: #cbd5e1;
}


.last-control-badge {
    background: #0f172a;
    color: #cbd5e1;
    border: 1px solid #475569;
    margin-left: 10px;
    font-size: 12px;
}


.overview-last-control {
    margin-left: 0;
    margin-top: 8px;
}


.parking-name-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 800;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    border-radius: 0;
}

.parking-name-button:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.small-muted {
    margin: 4px 0 0 0;
    font-size: 13px;
}


.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-button {
    display: inline-block;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: #0f172a;
    color: #cbd5e1;
    border: 1px solid #334155;
    font-weight: 800;
}

.filter-button.active {
    background: #38bdf8;
    color: #082f49;
    border-color: #38bdf8;
}

.fine-list {
    display: grid;
    gap: 12px;
}

.fine-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 16px;
}

@media (max-width: 700px) {
    .filter-buttons,
    .fine-row {
        display: block;
    }

    .filter-button {
        margin-top: 8px;
    }
}


.person-status-bar {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 12px;
}

.person-status-bar strong {
    color: #f8fafc;
}


.workday-actions {
    display: grid;
    gap: 10px;
    min-width: 110px;
}

.copy-button {
    background: #38bdf8;
    color: #082f49;
}

@media (max-width: 700px) {
    .workday-actions {
        display: block;
        min-width: 0;
    }
}


.workday-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.workday-actions form {
    margin: 0;
}

.workday-actions button {
    width: 100%;
}

.control-address {
    color: #94a3b8;
    font-size: 14px;
}


.controls-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.control-card {
    background: rgba(7, 15, 35, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    line-height: 1.7;
}

.control-place {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.control-address {
    font-size: 15px;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.control-time-row,
.control-fines {
    font-size: 14px;
    color: #e2e8f0;
}

.workday-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 16px;
}

.workday-actions form {
    margin: 0;
}

.workday-actions button {
    min-width: 110px;
}


.controls-section {
    margin-top: 24px;
}

.controls-title {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 18px;
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.control-card {
    background: linear-gradient(180deg, rgba(24,38,66,0.95) 0%, rgba(17,28,51,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.control-place {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.control-address {
    color: #cbd5e1;
    font-size: 18px;
    margin-bottom: 16px;
}

.control-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #f1f5f9;
    font-size: 17px;
}

.workday-actions {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 12px;
}

.workday-actions form {
    margin: 0;
}

.workday-actions button {
    min-width: 120px;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
}

.workday-card,
.workday-item,
.workday-box {
    position: relative;
}


/* v54 fixed workday controls layout */
.workday-row {
    position: relative !important;
    align-items: flex-start !important;
    gap: 24px !important;
}

.controls-section {
    margin-top: 22px !important;
    width: 100% !important;
}

.controls-title {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    margin: 0 0 14px 0 !important;
}

.controls-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin-top: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    border: 0 !important;
    max-width: none !important;
}

.control-card {
    background: linear-gradient(180deg, rgba(25, 41, 70, 0.96), rgba(17, 30, 55, 0.98)) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 16px !important;
    padding: 18px 20px !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22) !important;
    line-height: 1.45 !important;
    min-width: 520px !important;
}

.control-place {
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    margin-bottom: 6px !important;
}

.control-address {
    color: #cbd5e1 !important;
    font-size: 16px !important;
    margin-bottom: 12px !important;
}

.control-meta-line {
    color: #e2e8f0 !important;
    font-size: 15px !important;
    margin-top: 3px !important;
}

.control-meta-line strong {
    color: #ffffff !important;
}

.workday-actions {
    position: absolute !important;
    top: 22px !important;
    right: 22px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 14px !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 12px !important;
    min-width: 0 !important;
}

.workday-actions form {
    margin: 0 !important;
}

.workday-actions button {
    min-width: 96px !important;
    width: auto !important;
    padding: 12px 18px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
}

@media (max-width: 800px) {
    .control-card {
        min-width: 0 !important;
    }

    .workday-actions {
        position: static !important;
        justify-content: flex-start !important;
        padding-left: 0 !important;
        margin-top: 18px !important;
    }
}


.workday-row{
 position:relative !important;
 padding-right:180px !important;
}


/* v56 stable workday action layout */
.workday-row {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 28px !important;
    align-items: start !important;
    padding-right: 0 !important;
}

.workday-actions {
    position: static !important;
    top: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 14px !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 210px !important;
}

.workday-actions form {
    margin: 0 !important;
}

.workday-actions button {
    display: inline-block !important;
    min-width: 92px !important;
    width: auto !important;
    padding: 12px 18px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 850px) {
    .workday-row {
        display: block !important;
    }

    .workday-actions {
        justify-content: flex-start !important;
        margin-top: 18px !important;
    }
}


/* v57 parking fines page: grouped by date, control time frame */
.fine-date-heading {
    margin: 22px 0 10px 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
}

.fine-row {
    align-items: flex-start !important;
}

.fine-row strong {
    color: #ffffff;
}


/* v58 ticket page */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ticket-card {
    position: relative;
    background: #0b1730;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 18px 170px 18px 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.ticket-date {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.ticket-time-range {
    font-size: 16px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.ticket-place {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.ticket-address {
    font-size: 15px;
    color: #cbd5e1;
}

.ticket-open-button {
    position: absolute;
    right: 18px;
    top: 18px;
}

@media (max-width: 700px) {
    .ticket-card {
        padding-right: 20px;
    }

    .ticket-open-button {
        position: static;
        display: inline-block;
        margin-top: 14px;
    }
}


/* v59 smaller ticket button */
.ticket-card {
    position: relative;
    padding-right: 130px !important;
    min-height: 88px;
}

.ticket-open-button {
    position: absolute !important;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    width: auto !important;
    min-width: 92px;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .ticket-card {
        padding-right: 20px !important;
    }

    .ticket-open-button {
        position: static !important;
        transform: none !important;
        margin-top: 12px;
        display: inline-block;
    }
}


/* v60 real edit control */
.edit-control-button {
    display: inline-block;
    margin-top: 14px;
    text-decoration: none;
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
}

.edit-control-panel {
    background: #0b1730;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 20px;
}

.edit-control-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 22px;
}

.edit-control-place {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.edit-control-address {
    color: #cbd5e1;
    font-size: 16px;
    margin-bottom: 10px;
}

.edit-control-time {
    color: #e2e8f0;
    font-size: 16px;
}

.edit-control-actions {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.edit-control-actions form {
    margin: 0;
}

.ticket-edit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.ticket-edit-row {
    background: #13213d;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-edit-row form {
    margin: 0;
}

.ticket-delete-button {
    min-width: 0 !important;
    width: auto !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
}

.edit-control-footer {
    margin-top: 20px;
}

@media (max-width: 800px) {
    .edit-control-header,
    .edit-control-actions {
        display: block;
    }

    .edit-control-actions form {
        margin-top: 10px;
    }
}
