* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Roboto, sans-serif;
    background: #DDD;
    color: #ffffff;
}

body {
    min-height: 100vh;
    background-image: url('/form/assets/img/bg-pattern.png');
    background-size: 340px;
    background-repeat: repeat;
}

.header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 800;
    transition: 0.2s ease;
}

.header-link i {
    margin-right: 6px;
}

.header-link-primary {
    background: #85df8f;
    color: #fff;
}

.header-link-secondary {
    background: #85df8f;
    color: #fff;
}

.header-link-primary:hover {
    background: #6eb773;
}

.header-link-secondary:hover {
    background: #6eb773;
}

.page {
    min-height: calc(100vh - 84px);
    padding: 28px 32px 36px;
}

.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 1.6em;
    font-weight: 600;
    font-family: Inter, sans-serif;
    color: #111;
}

.page-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: #333;
}

.card {
    width: 100%;
    background: #f3f3f3;
    color: #111;
    border-radius: 10px;
    box-shadow: 10px rgba(0,0,0,0.35);
    overflow: hidden;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

thead tr {
    background: #ececec;

}

th {
    text-align: left;
    padding: 14px 18px;
    font-size: 1.2em;
    font-weight: 700;
    background: #7566fa;
    color: #FFF;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

td {
    padding: 8px 18px;
    font-size: 0.9em;
    color: #202020;
    border-bottom: 1px solid #e2e2e2;
    vertical-align: middle;
}

tbody tr:nth-child(odd) {
    background: #f7f7f7;
}

tbody tr:hover {
    background: #ebebeb;
}

.cliente-nombre {
    font-weight: 700;
    line-height: 1.35;
}

.estado-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 700;
}

.estado-badge i {
    margin-right: 5px;
}

.estado-pendiente {
    background: #de5863;
    color: #FFF;
}

.estado-ok {
    background: #ffb82f;
    color: #FFF;
}

.estado-check {
    background: #85df8f;
    color: #FFF;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 700;
    border: none;
    transition: 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn i {
    margin-right: 5px;
}

.btn-wa {
    background: #25D366;
    color: #fff;
}

.btn-wa:hover {
    background: #1fb458;
}

.btn-details,
.btn-edit,
.btn-delete
 {
    background: #666;
    color: #fff;
}

.btn-details:hover,
.btn-edit:hover,
.btn-delete:hover {
    background: #555;
}

.empty {
    padding: 32px 24px;
    text-align: center;
    color: #666;
    font-size: 15px;
}

:root {
    --sidebar-collapsed: 84px;
    --sidebar-expanded: 240px;
}

/* Quitamos dependencia del header superior */
body {
    overflow-x: hidden;
}

/* Layout general */
.layout {
    margin-left: var(--sidebar-collapsed);
    min-height: 100vh;
    transition: margin-left 0.28s ease;
}

.sidebar:hover ~ .layout {
    margin-left: var(--sidebar-expanded);
}

.page {
    min-height: 100vh;
    padding: 28px 32px 36px;
    transition: padding 0.28s ease;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-collapsed);
    height: 100vh;
    background: rgba(10, 10, 10, 0.96);
    border-right: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    z-index: 100;
    overflow: hidden;
    transition: width 0.28s ease;
}

.sidebar:hover {
    width: var(--sidebar-expanded);
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 12px;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.sidebar-bottom {
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar:hover .sidebar-logo {
    justify-content: center;
    padding-left: 4px;
}

.sidebar-logo img {
    width: 38px;
    height: auto;
    display: block;
}

.sidebar:hover .sidebar-logo img {
    width: 38px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s ease, color 0.2s ease;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
}

.sidebar-link.is-active {
    background: #7566fa;
    color: #fff;
}

.sidebar-link-logout {
    color: #555;
}

.sidebar-icon {
    width: 30px;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
}

.sidebar-text {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
}

.sidebar:hover .sidebar-text {
    opacity: 1;
    transform: translateX(0);
}

/* Ajustes a botones superiores ya existentes */
.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: 0.2s ease;
}

.header-link i {
    margin-right: 6px;
}

.form-card {
    max-width: 980px;
}

.form-card-inner {
    padding: 26px;
}

.admin-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 14px;
    font-weight: 700;
    color: #1e1e1e;
    font-family: Inter, sans-serif;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    padding: 0 14px;
    font-size: 15px;
    color: #222;
    font-family: Roboto, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea {
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #7566fa;
    box-shadow: 0 0 0 4px rgba(117, 102, 250, 0.12);
}

.input-prefix {
    display: flex;
    align-items: center;
    min-height: 46px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-prefix:focus-within {
    border-color: #7566fa;
    box-shadow: 0 0 0 4px rgba(117, 102, 250, 0.12);
}

.input-prefix span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 46px;
    background: #f3f3f8;
    color: #555;
    font-weight: 700;
    border-right: 1px solid #dddddd;
}

.input-prefix input {
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.input-prefix input:focus {
    box-shadow: none;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-light {
    background: #ececf3;
    color: #222;
}

.btn-light:hover {
    background: #ddddea;
}

.btn-primary {
    background: #7566fa;
    color: #fff;
}

.btn-primary:hover {
    background: #6454f0;
}

.form-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.form-alert-error {
    background: #ffe5ea;
    color: #8a1d35;
    border: 1px solid #f2b8c4;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-card {
    border-radius: 12px;
}

.detail-card-full {
    grid-column: 1 / -1;
}

.detail-card-header {
    padding: 18px 22px;
    background: #7566fa;
    color: #fff;
}

.detail-card-header h3 {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-card-body {
    padding: 22px;
}

.detail-list {
    display: grid;
    gap: 8px;
}

.detail-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    align-items: start;
    padding-bottom: 8px;
    border-bottom: 1px solid #e7e7e7;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    font-family: Inter, sans-serif;
}

.detail-value {
    font-size: 15px;
    color: #222;
    word-break: break-word;
}

.detail-code {
    font-family: monospace;
    font-size: 13px;
}

.detail-group + .detail-group {
    margin-top: 18px;
}

.detail-group h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #222;
    font-family: Inter, sans-serif;
}

.detail-group ul {
    margin: 0;
    padding-left: 18px;
}

.detail-group li {
    margin-bottom: 6px;
    color: #333;
}

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

.detail-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.detail-table th {
    background: #f1efff;
    color: #3b2ebd;
    font-size: 14px;
    padding: 12px 14px;
}

.detail-table td {
    padding: 12px 14px;
    font-size: 14px;
}

.detail-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.empty-state {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.slots-selector {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.slots-day {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slots-day-title {
    font-size: 14px;
    font-weight: 700;
    color: #444;
    font-family: Inter, sans-serif;
}

.slots-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.slot-pill {
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #222;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.slot-pill:hover {
    border-color: #7566fa;
    color: #7566fa;
}

.slot-pill.is-selected {
    background: #7566fa;
    border-color: #7566fa;
    color: #fff;
}

audio {
    width: 100%;
    max-width: 400px;
    height: 40px;
    filter: grayscale(1) contrast(0.9) brightness(0.9);
    opacity: 0.85;
}

/* Webkit (Chrome / Safari) */
audio::-webkit-media-controls-panel {
    background-color: #e0e0e0;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-mute-button {
    filter: grayscale(1);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #333;
}

/* ######## MOBILE ######### */

@media (max-width: 700px) {
    .detail-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .detail-card-body {
        padding: 18px;
    }

    .detail-actions {
        justify-content: stretch;
    }

    .detail-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card-inner {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn,
    .form-actions a {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-card-full {
        grid-column: auto;
    }
}

@media (max-width: 1100px) {
    header {
        padding: 0 18px;
    }

    .page {
        padding: 20px 18px 24px;
    }

    header h1 {
        font-size: 24px;
    }

     .layout {
        margin-left: 74px;
    }

    .sidebar {
        width: 74px;
    }

    .sidebar:hover {
        width: 220px;
    }

    .sidebar:hover ~ .layout {
        margin-left: 220px;
    }

    .page {
        padding: 20px 18px 24px;
    }
}