/* ==========================================================================
   Servizi Generali · Plant Samp Concorezzo – Stylesheet
   ========================================================================== */

:root {
    --bg-page: #f4f3ee;
    --bg-card: #ffffff;
    --bg-card-done: #dcece2;
    --border-card: #e5e3db;
    --border-card-done: #9ec7af;
    --bg-input: #f4f3ef;
    --border-input: #dcdad1;
    --text-main: #1f252c;
    --text-muted: #626b73;
    --navy-primary: #1b436b;
    --navy-hover: #143353;
    --green-check: #1e7e48;
    --green-bg-soft: #e6f4ec;
    --amber-border: #c6982c;
    --amber-text: #8c6710;
    --amber-bg: #fffdf5;
    --row-pending: #efe5e0;
    --danger-red: #c93b3b;
    --danger-border: #ebcccc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 30px rgba(18, 28, 45, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 12px;
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.login-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.login-form input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    background: var(--bg-input);
    font-size: 14px;
    color: var(--text-main);
}

.login-form input:focus {
    outline: 2px solid var(--navy-primary);
    background: #ffffff;
}

.alert-box {
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
}

.alert-error {
    background: #fdf0f0;
    border: 1px solid var(--danger-border);
    color: var(--danger-red);
}

/* ==========================================================================
   Topbar Header
   ========================================================================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-page);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
    gap: 12px;
}

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

.topbar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
    background: #ffffff;
    color: var(--text-main);
    border-color: var(--border-card);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.btn-add-check {
    appearance: none;
    border: none;
    background: var(--navy-primary);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 4px;
    transition: background 0.15s ease;
}

.btn-add-check:hover {
    background: var(--navy-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--border-input);
}

.user-badge {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.logout-form {
    margin: 0;
}

.btn-logout {
    appearance: none;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-logout:hover {
    border-color: var(--danger-red);
    color: var(--danger-red);
}

/* ==========================================================================
   Main Container & Filter Pills
   ========================================================================== */
.main-container {
    max-width: 960px;
    margin: 22px auto 60px;
    padding: 0 18px;
}

.rls-intro-note {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-pill {
    appearance: none;
    border: 1px solid var(--border-card);
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    border-color: #c5c2b8;
}

.filter-pill.active {
    background: var(--navy-primary);
    border-color: var(--navy-primary);
    color: #ffffff;
    font-weight: 600;
}

/* ==========================================================================
   Task Cards (Check & RLS)
   ========================================================================== */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 15px 18px;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.task-card.is-completed {
    background: var(--bg-card-done);
    border-color: var(--border-card-done);
}

.task-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.badge-dafare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 11px;
    border-radius: 999px;
    border: 1px solid var(--amber-border);
    background: var(--amber-bg);
    color: var(--amber-text);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.task-title-text {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-main);
}

.task-admin-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.icon-btn-inline {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border-input);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-muted);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.icon-btn-inline:hover {
    background: #ffffff;
    color: var(--text-main);
    border-color: #b5b2a8;
}

.icon-btn-inline.delete-btn {
    border-color: var(--danger-border);
    color: var(--danger-red);
}

.icon-btn-inline.delete-btn:hover {
    background: #fdf0f0;
    border-color: var(--danger-red);
}

.task-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.task-desc {
    font-size: 13px;
    color: #363f45;
    margin: 0;
}

/* Opzioni compito a destra:
   1) Quadrato con bordo nero e angoli smussati -> se premuto bordo verde + checkmark verde
   2) Pulsante + Ticket accanto */
.task-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.check-square-btn {
    appearance: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 2px solid #141414;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.18s ease;
    position: relative;
}

.check-square-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.check-square-btn .checkmark-icon {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.18s ease, color 0.15s ease;
    user-select: none;
}

.check-square-btn.is-completed {
    border-color: var(--green-check);
    border-width: 2.5px;
    background: #ffffff;
}

.check-square-btn.is-completed .checkmark-icon {
    color: var(--green-check);
    opacity: 1;
    transform: scale(1);
}

.btn-ticket {
    appearance: none;
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-ticket:hover {
    border-color: var(--navy-primary);
    color: var(--navy-primary);
    background: #f9fbfd;
}

.ticket-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
}

/* ==========================================================================
   Registro View (Foto 3)
   ========================================================================== */
.registro-controls {
    margin-bottom: 14px;
}

.registro-type-bar {
    margin-bottom: 10px;
}

.registro-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.registro-subbar .filter-bar {
    margin-bottom: 0;
}

.registro-date-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.registro-date-picker input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: var(--text-main);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.registro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.registro-table thead th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1.5px solid #9da3a8;
}

.registro-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #e4dfd9;
    vertical-align: middle;
}

.registro-table tbody tr.row-pending {
    background-color: var(--row-pending);
}

.registro-table tbody tr.row-done {
    background-color: transparent;
}

.cell-date {
    font-weight: 700;
    white-space: nowrap;
}

.cell-code {
    font-weight: 700;
    white-space: nowrap;
}

.pill-esito-ok {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--green-check);
    color: var(--green-check);
    background: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    margin-right: 4px;
}

.esito-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.pill-esito-pending {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid var(--amber-border);
    color: var(--amber-text);
    background: var(--amber-bg);
    font-size: 11.5px;
    font-weight: 600;
}

.btn-nota-link {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-nota-link:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Admin View
   ========================================================================== */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-toolbar .filter-bar {
    margin-bottom: 0;
}

.admin-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.admin-section-desc {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-card);
}

.badge-role,
.badge-cat {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-cat-check {
    background: #e7eff8;
    color: var(--navy-primary);
}

.badge-cat-rls {
    background: #fcee6;
    background-color: #faeedb;
    color: #965d0e;
}

.badge-status-active {
    color: var(--green-check);
    font-weight: 600;
}

.badge-status-inactive {
    color: var(--danger-red);
    font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    appearance: none;
    border: none;
    background: var(--navy-primary);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--navy-hover);
}

.btn-secondary-dark {
    appearance: none;
    border: 1px solid var(--navy-primary);
    background: #ffffff;
    color: var(--navy-primary);
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 9px;
    cursor: pointer;
}

.btn-secondary-dark:hover {
    background: #f0f5fa;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14.5px;
}

.btn-sm {
    appearance: none;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 4px;
}

.btn-sm:hover {
    border-color: var(--navy-primary);
    color: var(--navy-primary);
}

.btn-sm-danger {
    border-color: var(--danger-border);
    color: var(--danger-red);
}

.btn-sm-danger:hover {
    border-color: var(--danger-red);
    background: #fdf0f0;
    color: var(--danger-red);
}

/* ==========================================================================
   Modals (Nuovo Ticket Foto 4 + Admin Modals)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 34, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
    overflow-y: auto;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px 26px 22px;
    box-shadow: var(--shadow-md);
}

.modal-small {
    max-width: 440px;
}

.modal-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    color: #12161a;
}

.ticket-field {
    margin-bottom: 15px;
}

.ticket-field label {
    display: block;
    font-size: 13.5px;
    color: #636b72;
    margin-bottom: 6px;
    font-weight: 500;
}

.ticket-field input[type="text"],
.ticket-field input[type="date"],
.ticket-field input[type="number"],
.ticket-field input[type="password"],
.ticket-field select,
.ticket-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-input);
    font-size: 15px;
    color: var(--text-main);
    font-family: inherit;
}

.ticket-field input:focus,
.ticket-field select:focus,
.ticket-field textarea:focus {
    outline: 2px solid var(--navy-primary);
    background: #ffffff;
}

.ticket-task-desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: #5f676e;
    line-height: 1.4;
}

.input-with-mic {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-mic input,
.input-with-mic textarea {
    padding-right: 50px;
}

.mic-btn {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-input);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s ease;
}

.textarea-with-mic .mic-btn {
    top: 10px;
}

.mic-btn:hover,
.mic-btn.is-listening {
    border-color: var(--navy-primary);
    background: #eef4fa;
}

.photo-buttons-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-photo {
    appearance: none;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-main);
    font-size: 14.5px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-photo:hover {
    border-color: var(--navy-primary);
    background: #f8fafc;
}

.photo-selected-name {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--green-check);
    font-weight: 600;
}

.modal-footer-btns {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.btn-cancel-modal {
    appearance: none;
    flex: 1;
    padding: 13px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-input);
    background: #ffffff;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.btn-cancel-modal:hover {
    background: #f5f5f2;
}

.btn-submit-ticket {
    appearance: none;
    flex: 1.6;
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    background: var(--navy-primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit-ticket:hover {
    background: var(--navy-hover);
}

.btn-danger-solid {
    appearance: none;
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    background: var(--danger-red);
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ==========================================================================
   Toast Banner & Empty State
   ========================================================================== */
.toast-banner {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: #1f252c;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 300;
}

.toast-banner.toast-error {
    background: var(--danger-red);
}

.toast-banner.toast-success {
    background: var(--green-check);
}

.empty-state {
    background: #ffffff;
    border: 1px dashed var(--border-input);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
}

@media (max-width: 680px) {
    .task-card {
        flex-direction: column;
        align-items: stretch;
    }
    .task-actions {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Home Dashboard (Admin Landing Page)
   ========================================================================== */
.home-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 22px;
}

.home-logo-slot {
    width: 98px;
    height: 64px;
    background: #ffffff;
    border: 1.5px dashed #dcdad1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #7c848c;
    flex-shrink: 0;
}

.home-greeting-center {
    text-align: center;
    flex: 1;
}

.home-date-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.home-greeting-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #12161a;
}

.home-top-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.home-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.home-stat-num {
    font-size: 26px;
    font-weight: 600;
    color: #14181d;
    line-height: 1.2;
}

.home-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.home-kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 132px;
}

.kpi-title {
    font-size: 12.5px;
    color: #4f575e;
    margin-bottom: 10px;
    line-height: 1.3;
}

.kpi-value {
    font-size: 27px;
    font-weight: 600;
    color: #14181d;
    line-height: 1.15;
    margin-bottom: 12px;
}

.kpi-bar-track {
    width: 100%;
    height: 6px;
    background: #e5e4de;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.kpi-bar-track.track-outlined {
    background: #ffffff;
    border: 1px solid #9da3a8;
}

.kpi-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.kpi-bar-fill.fill-red {
    background: #c83e37;
}

.kpi-bar-fill.fill-green {
    background: #1e7e48;
}

.kpi-bar-fill.fill-white {
    background: #ffffff;
}

.kpi-bar-fill.w-0   { width: 0%; }
.kpi-bar-fill.w-4   { width: 4%; }
.kpi-bar-fill.w-5   { width: 5%; }
.kpi-bar-fill.w-10  { width: 10%; }
.kpi-bar-fill.w-15  { width: 15%; }
.kpi-bar-fill.w-20  { width: 20%; }
.kpi-bar-fill.w-25  { width: 25%; }
.kpi-bar-fill.w-30  { width: 30%; }
.kpi-bar-fill.w-35  { width: 35%; }
.kpi-bar-fill.w-40  { width: 40%; }
.kpi-bar-fill.w-45  { width: 45%; }
.kpi-bar-fill.w-50  { width: 50%; }
.kpi-bar-fill.w-55  { width: 55%; }
.kpi-bar-fill.w-60  { width: 60%; }
.kpi-bar-fill.w-65  { width: 65%; }
.kpi-bar-fill.w-70  { width: 70%; }
.kpi-bar-fill.w-75  { width: 75%; }
.kpi-bar-fill.w-80  { width: 80%; }
.kpi-bar-fill.w-85  { width: 85%; }
.kpi-bar-fill.w-90  { width: 90%; }
.kpi-bar-fill.w-95  { width: 95%; }
.kpi-bar-fill.w-100 { width: 100%; }

.kpi-footer {
    font-size: 11.5px;
    color: var(--text-muted);
}

.kpi-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #171a1d;
    color: #f3f4f6;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    z-index: 40;
    pointer-events: none;
}

.kpi-tooltip-head {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a3aab2;
    margin-bottom: 3px;
}

.home-kpi-card:hover .kpi-tooltip {
    display: block;
}

.home-kpi-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 26px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.dot-red {
    background: #c83e37;
}

.legend-dot.dot-green {
    background: #1e7e48;
}

.legend-dot.dot-white {
    background: #ffffff;
    border: 1px solid #8c939a;
}

.home-block {
    margin-bottom: 24px;
}

.home-block-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #5b636a;
    text-transform: uppercase;
}

.home-block-content {
    font-size: 13px;
    color: #4f575e;
}

.home-rls-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 820px) {
    .home-kpi-grid,
    .home-rls-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .home-top-summary,
    .home-kpi-grid,
    .home-rls-summary {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Daily Report Admin Section
   ========================================================================== */
.report-recipients-wrap {
    margin-bottom: 22px;
}

.report-config-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.report-config-form {
    margin-top: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ticket-field input[type="time"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-input);
    font-size: 15px;
    color: var(--text-main);
    font-family: inherit;
}

.report-last-sent-box {
    padding: 12px 14px;
    border: 1px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-input);
    font-size: 13.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.report-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 6px;
}

.report-check-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13.5px !important;
    color: var(--text-main) !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.report-check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.report-config-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.report-preview-pre {
    margin: 12px 0 0;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-main);
    max-height: 380px;
    overflow-y: auto;
}

.recipient-select-cb {
    width: 18px;
    height: 18px;
    accent-color: var(--green-check);
    cursor: pointer;
}

@media (max-width: 760px) {
    .form-row-3,
    .report-checkbox-grid {
        grid-template-columns: 1fr;
    }
}
