/* ==========================================================================
   Duty Scheduler 5.6
   ========================================================================== */

.ds-panel,
.ds-auth-box,
.ds-card {
    --ds-blue: #4682b4;
    --ds-blue-dark: #3a6b96;
    --ds-green: #2e7d32;
    --ds-red: #c62828;
    --ds-border: #d8dde3;
    --ds-bg-soft: #f7f9fb;
    --ds-text-muted: #6b7280;
}

/* --------------------------------------------------------------------------
   Obrasci
   -------------------------------------------------------------------------- */

.ds-form,
.ds-auth-box {
    max-width: 520px;
    margin: 0 auto;
}

.ds-auth-box {
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 10px;
    padding: 24px;
}

.ds-auth-box h2 {
    margin-top: 0;
    text-align: center;
}

.ds-form {
    background: transparent;
    border: 0;
    padding: 0;
}

.ds-form label,
.ds-card label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 600;
}

.ds-form input[type="text"],
.ds-form input[type="email"],
.ds-form input[type="password"],
.ds-form input[type="search"],
.ds-form input[type="number"],
.ds-form select,
.ds-card input[type="text"],
.ds-card input[type="email"],
.ds-card input[type="search"],
.ds-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    font-size: 16px; /* Sprječava automatsko zumiranje na iOS-u. */
    box-sizing: border-box;
    background: #fff;
}

.ds-form input[type="submit"],
.ds-card input[type="submit"] {
    margin-top: 16px;
    background-color: var(--ds-blue);
    color: #fff;
    border: 0;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
}

.ds-form input[type="submit"]:hover,
.ds-card input[type="submit"]:hover {
    background-color: var(--ds-blue-dark);
}

.ds-password-wrap {
    position: relative;
}

.ds-password-wrap input {
    padding-right: 46px !important;
}

.ds-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
}

.ds-toggle-password.is-visible {
    opacity: 0.55;
}

.ds-hint {
    color: var(--ds-text-muted);
    font-size: 0.9em;
    margin: 8px 0 0;
}

.ds-muted {
    color: var(--ds-text-muted);
}

.ds-auth-box__alt {
    text-align: center;
    margin: 16px 0 0;
    font-size: 0.95em;
}

/* --------------------------------------------------------------------------
   Prijava Google računom
   -------------------------------------------------------------------------- */

.ds-oauth {
    margin-top: 4px;
}

.ds-oauth__setup {
    text-align: center;
    margin-top: 10px;
}

.ds-form__aside {
    margin: 6px 0 0;
    font-size: .9em;
}

/* U kutiji za prijavu/registraciju glavni gumb ide punom širinom, kao i
   gumb za Google ispod njega. */
.ds-auth-box .ds-form input[type="submit"] {
    width: 100%;
    padding: 13px 20px;
}

.ds-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    background: #fff;
    color: #3c4043 !important;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-family: "Roboto", -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ds-google-btn:hover {
    background: #f7f8f8;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.ds-google-btn__icon {
    display: inline-flex;
    align-items: center;
}

.ds-oauth__divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.ds-oauth__divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--ds-border);
}

.ds-oauth__divider span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    color: var(--ds-text-muted);
    font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   Poruke
   -------------------------------------------------------------------------- */

.ds-notices {
    margin: 0 0 16px;
}

.ds-notice {
    padding: 12px 14px;
    border-radius: 6px;
    border-left: 4px solid var(--ds-blue);
    background: var(--ds-bg-soft);
    margin: 0 0 10px;
}

.ds-notice--success {
    border-left-color: var(--ds-green);
    background: #edf7ee;
}

.ds-notice--error {
    border-left-color: var(--ds-red);
    background: #fdecea;
}

.ds-notice--info {
    border-left-color: var(--ds-blue);
}

.ds-notice p {
    margin: 0 0 8px;
}

/* --------------------------------------------------------------------------
   Gumbi
   -------------------------------------------------------------------------- */

.ds-btn {
    display: inline-block;
    background-color: var(--ds-blue);
    color: #fff !important;
    padding: 10px 18px;
    text-decoration: none !important;
    border: 0;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
}

.ds-btn:hover {
    background-color: var(--ds-blue-dark);
}

.ds-btn--small {
    padding: 7px 12px;
    font-size: 14px;
}

.ds-btn--ghost {
    background: #fff;
    color: var(--ds-blue) !important;
    border: 1px solid var(--ds-blue);
}

.ds-btn--ghost:hover {
    background: var(--ds-bg-soft);
}

.ds-btn--danger {
    background-color: var(--ds-red);
}

.ds-btn--danger:hover {
    background-color: #a01f1f;
}

.ds-btn--success {
    background-color: var(--ds-green);
}

.ds-btn--success:hover {
    background-color: #1f5c23;
}

.ds-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.ds-icon-btn {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    padding: 6px;
    border-radius: 4px;
}

.ds-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   Panel i kartice
   -------------------------------------------------------------------------- */

.ds-panel__header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-panel__greeting {
    margin: 0;
}

.ds-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ds-tab {
    flex: 1 1 auto;
    min-width: 150px;
    background: #fff;
    color: var(--ds-blue);
    border: 1px solid var(--ds-blue);
    border-radius: 6px;
    padding: 11px 14px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.ds-tab:hover {
    background: var(--ds-bg-soft);
}

.ds-tab.is-active {
    background: var(--ds-blue);
    color: #fff;
    border-color: var(--ds-blue-dark);
}

.ds-tab-panel {
    display: none;
}

.ds-tab-panel.is-active {
    display: block;
}

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

.ds-card h2 {
    margin-top: 0;
}

.ds-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.ds-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ds-slot-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ds-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
}

.ds-inline-form label {
    margin: 0;
}

.ds-inline-form input[type="submit"] {
    margin-top: 0;
}

.ds-inline-form--tight {
    display: inline-flex;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Dežurstva i tablice
   -------------------------------------------------------------------------- */

.ds-shift {
    padding: 14px 0;
    border-bottom: 1px solid var(--ds-border);
}

.ds-shift:last-child {
    border-bottom: 0;
}

.ds-shift h3 {
    margin: 0 0 10px;
}

.ds-shift-block {
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.ds-shift-block__head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ds-shift-block__head h3 {
    margin: 0;
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
}

.ds-table th,
.ds-table td {
    padding: 8px 10px;
    border: 1px solid var(--ds-border);
    text-align: left;
    vertical-align: middle;
}

.ds-table thead th {
    background: var(--ds-bg-soft);
}

.ds-slot--full {
    background: #e3f4e4;
}

.ds-slot--open {
    background: #fff;
}

.ds-reservation-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.ds-reservation-entry__tools {
    white-space: nowrap;
}

.ds-reservation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-reservation-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--ds-border);
}

.ds-reservation-list li:last-child {
    border-bottom: 0;
}

.ds-toggle-line {
    margin: 0 0 12px;
    font-size: 0.95em;
}

.ds-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.ds-pagination__link {
    padding: 7px 12px;
    border: 1px solid var(--ds-border);
    border-radius: 5px;
    text-decoration: none;
}

.ds-pagination__link.is-current {
    background: var(--ds-blue);
    color: #fff;
    border-color: var(--ds-blue-dark);
}

.ds-role--admin {
    font-weight: 700;
    color: var(--ds-blue-dark);
}

.ds-return {
    text-align: center;
    margin: 16px 0;
}

.ds-return .ds-hint {
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.ds-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 16px;
}

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

.ds-modal__content {
    background: #fff;
    border-radius: 10px;
    padding: 22px;
    width: 100%;
    max-width: 520px;
    margin: auto;
}

/* Kalendar unutar modala.
   flatpickr omota polje u .flatpickr-wrapper, koji je po zadanom inline-block
   i stisnuo bi polje; zato ga širimo na punu širinu. Kalendar mora biti iznad
   polja koja slijede ispod njega. */
.ds-modal .flatpickr-wrapper {
    display: block;
    width: 100%;
}

.ds-modal .flatpickr-calendar.static {
    z-index: 10;
}

.ds-modal .flatpickr-calendar.static.open {
    z-index: 20;
}

.ds-modal__content h3 {
    margin-top: 0;
}

.ds-modal__content label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 600;
}

.ds-modal__content input,
.ds-modal__content select {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    font-size: 16px;
    background: #fff;
}

.ds-modal__error {
    color: var(--ds-red);
    margin: 12px 0 0;
    font-size: 0.95em;
}

.ds-modal__buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

body.ds-modal-open {
    overflow: hidden;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Mobilni uređaji
   -------------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    .ds-tab {
        min-width: 100%;
    }

    .ds-card,
    .ds-auth-box {
        padding: 16px;
    }

    .ds-shift-block {
        padding: 10px;
    }

    .ds-table th,
    .ds-table td {
        padding: 8px 6px;
    }

    .ds-table--users {
        display: block;
        overflow-x: auto;
    }

    .ds-modal {
        padding: 0;
    }

    .ds-modal__content {
        min-height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 16px 16px 90px;
    }

    .ds-modal__buttons {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        padding: 10px 16px;
        box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12);
        margin: 0;
    }

    .ds-modal__buttons .ds-btn {
        flex: 1;
        text-align: center;
    }

    .flatpickr-calendar {
        max-width: 100% !important;
    }
}

/* Broj osoba po terminu, po pojedinom dežurstvu */
.ds-capacity-form { gap: 6px; }

.ds-capacity-input {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid var(--ds-border, #d8dde3);
    border-radius: 5px;
    font-size: 14px;
}

.ds-capacity-form .ds-hint { margin: 0; white-space: nowrap; }
