:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --accent: #0ea5e9;
    --border: #e0e4e9;
    --ok: #16a34a;
    --danger: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f4f9;
    display: flex;
    /* justify-content: center; */
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
}
.auth-card {
    background: #fff;
    padding: 28px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 360px;
}
input[type="password"] {
    width: 100%;
    height: 48px;
    font-size: 1rem;
    padding: 0 12px;
    margin: 12px 0 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box;
}
button {
    width: 100%;
    height: 48px;
    background: #0d6efd;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.err { color: #dc3545; font-size: 0.9rem; margin-bottom: 8px; }
/*2*/        
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f4f9;
    color: #212529;
    display: flex;
    flex-direction: column;

    /* justify-content: center; */
    align-items: flex-start;
    min-height: 100vh;
    padding: 16px;
}

.card {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
        align-self: center;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    text-align: center;
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: #0d6efd;
}

label {
    display: block;
    margin-top: 14px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="number"], select {
    width: 100%;
    height: 48px;
    padding: 10px 12px;
    margin-top: 6px;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    -webkit-appearance: none;
}

input[type="number"]:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.quick-select-label {
    display: block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

.quick-select-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.quick-select-grid button {
    width: 100%;
    height: 44px;
    margin-top: 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    background: #6c757d;
    border-radius: 6px;
}

.quick-select-grid button:active {
    background: #495057;
}

button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 48px;
    margin-top: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #0d6efd;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease-in-out;
}

button:hover {
    background: #0b5ed7;
}

button:active {
    background: #0a58ca;
}

button.stop {
    background: #dc3545;
}

button.stop:hover {
    background: #bb2d3b;
}

button.stop:active {
    background: #b02a37;
}

.stats {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 16px;
    border-radius: 8px;
    margin-top: 8px;
}

.stats > p {
    margin: 8px 0;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eef0f2;
    padding-bottom: 6px;
}

.stats > div.statval {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eef0f2;
    padding-bottom: 6px;
    margin: 8px 0;
    div {
        align-content: center;
    }
}

.stats p:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

@media (max-width: 380px) {
    .quick-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Progress Bar */
.progress-wrapper {
    margin: 16px 0;
    background-color: #e9ecef;
    border-radius: 12px;
    height: 24px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    background-color: #e9ecef;
    
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
    float: right;
}
.progress-fill-color {
    /*background-color: #198754;*/
    background-image: linear-gradient(to right, red,yellow , green);
    mask-composite: subtract, add;
    height: 100%;
    width: 100%;
    transition: width 0.4s ease;
    
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: bold;
    color: #212529;
}

/* Calculator Sections */
.calc-panel {
    background: #fdfdfd;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 14px;
    margin-top: 14px;
}
.calc-panel h4 {
    font-size: 0.92rem;
    color: #495057;
    margin-bottom: 6px;
}
.calc-panel input {
    height: 40px;
    margin-top: 4px;
}
.calc-result {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #0d6efd;
    min-height: 1.2rem;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(34px);
    -ms-transform: translateX(34px);
    transform: translateX(34px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}
div#costFlex * {
    align-content: center;
    padding: 0 1em;
}

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .55rem .15rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f9fafb; font-weight: 600; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.badge {
    display: inline-block; padding: .15rem .5rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
}
.badge.active   { background: #dcfce7; color: var(--ok); }
.badge.inactive { background: #f1f5f9; color: var(--muted); }
.msg  { background: #dcfce7; color: var(--ok); border: 1px solid #86efac; }
.err  { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.msg, .err { padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
td {
    .btn {
        display: inline-block; padding: .3rem .7rem; border-radius: 6px;
        border: 1px solid var(--border); background: #fff; color: var(--text);
        font-size: .8rem; text-decoration: none; cursor: pointer;
    }
    .btn:hover { border-color: var(--accent); color: var(--accent); }
    .btn.danger { color: var(--danger); }
    .btn.danger:hover { border-color: var(--danger); }
}
input[type="text"], input[type="number"], input[type="datetime-local"] {
    width: 100%; padding: .3rem .4rem; border: 1px solid var(--border);
    border-radius: 6px; font-size: .85rem;
}
.editing td { background: #fffbeb !important; }

 /* --- Edit panel (replaces inline row editing) --- */
.edit-panel { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.edit-panel h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.edit-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 600; }
.edit-grid label.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text); }
.edit-actions { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; }

.row-actions { display: flex; gap: .4rem; }

/* --- Mobile: table rows collapse into cards --- */
@media (max-width: 960px){
    body { padding: 1rem; }
    thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
    tr:hover td { background: transparent; }
    td {
        display: flex; justify-content: space-between; align-items: center;
        gap: 1rem; padding: .3rem .25rem; border-bottom: none;
        white-space: normal; text-align: right;
    }
    /* Pull the column name from the data-label attribute */
    td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .78rem; text-align: left; }
    td.row-actions { justify-content: flex-end; padding-top: .6rem; }
    td.row-actions::before { content: none; }
    td.hide-mobile { display: none; }
    .edit-grid { grid-template-columns: 1fr; }
}

 /* --- Sessions table: edit panel + mobile card layout --- */
.edit-panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; margin-top: 0; font-weight: 600; font-size: .8rem; color: #6c757d; }
.edit-grid label input { margin-top: 0; }
.edit-grid input[type="datetime-local"] {
    width: 100%; height: 48px; padding: 10px 12px; font-size: 1rem;
    border: 1px solid #ced4da; border-radius: 8px; box-sizing: border-box;
}
.edit-grid label.checkbox { flex-direction: row; align-items: center; gap: 8px; font-size: .9rem; color: #212529; }
.edit-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 10px; }
.edit-actions button { flex: 1; margin-top: 0; }
.edit-actions .btn { flex: 1; text-align: center; box-sizing: border-box; height: 48px; line-height: 44px; }
.row-actions { display: flex; gap: 6px; }

@media (max-width: 960px){
    /* Rows collapse into stacked cards */
    .sessions-card thead { display: none; }
    .sessions-card table, .sessions-card tbody, .sessions-card tr, .sessions-card td { display: block; width: 100%; }
    .sessions-card tr { border-bottom: 1px solid #e9ecef; padding: 8px 0; }
    .sessions-card td {
        display: flex; justify-content: space-between; align-items: center;
        gap: 12px; padding: 4px 8px; border-bottom: none;
        white-space: normal; text-align: right;
    }
    /* Pull the column name from the data-label attribute */
    .sessions-card td::before { content: attr(data-label); font-weight: 600; color: #6c757d; font-size: .78rem; text-align: left; }
    .sessions-card td.row-actions { justify-content: flex-end; padding-top: 10px; }
    .sessions-card td.row-actions::before { content: none; }
    .sessions-card td.hide-mobile { display: none; }
    .edit-grid { grid-template-columns: 1fr; }
}