/* ============================================================
   Unique Estudio - Salón de Belleza
   Hoja de Estilos Principal
   ============================================================ */

:root {
    --primary: #89515d;
    --primary-light: #a86d76;
    --gold: #bd9566;
    --dark: #302a2c;
    --light-bg: #f6f4f1;
    --card-bg: #ffffff;
    --text-main: #302d2b;
    --text-muted: #817a76;
    --border-color: #e8e3df;
    --success: #2e9e6a;
    --warning: #e09f3e;
    --danger: #e23e57;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, li {
    list-style: none;
}

/* --- LAYOUT PAGES --- */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #302a2c 0%, #262224 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    min-height: 82px;
    padding: 22px 22px;
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ead7c3;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: .3px;
}

.sidebar-header i { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(234,215,195,.35); border-radius: 50%; color: #d7b998; font-size: 14px; }

.sidebar-menu {
    padding: 26px 14px;
}

.sidebar-menu li {
    margin-bottom: 7px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #bcb5b4;
    transition: all .2s ease;
}

.sidebar-menu a i { width: 17px; color: #a99591; text-align: center; font-size: 14px; }

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.055);
    color: #fff;
}

.sidebar-menu a.active {
    background: rgba(183,132,128,.18);
    border-color: rgba(220,183,166,.16);
    color: #fff;
}

.sidebar-menu a.active i { color: #e4bda8; }

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* TOP BAR */
.top-bar {
    background: rgba(255,255,255,.94);
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 3vw, 42px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.35px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0e6e1;
    color: #81565b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 12px;
}

.user-rol {
    font-size: 10px;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--danger);
    font-size: 18px;
    padding: 10px;
    border-radius: 8px;
}

.btn-logout:hover {
    background: #fde8ea;
}

/* CONTAINER */
.page-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: clamp(22px, 3vw, 38px);
    flex: 1;
}

/* --- COMPONENTES --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 20px rgba(54,42,37,.035);
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 13px;
    transition: all .2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover, .btn-gold:hover, .btn-danger:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 5px 13px rgba(48,42,44,.12); }

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

.btn-gold {
    background: var(--gold);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* TABLAS */
.table-wrapper {
    background: #fff;
    border-radius: 14px;
    padding: 8px 22px 18px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    box-shadow: 0 5px 20px rgba(54,42,37,.035);
}

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

th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 15px 11px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 11px;
    border-bottom: 1px solid var(--border-color);
    color: #514c49;
    font-size: 13px;
}

tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #fbf8f5; }

tr:last-child td {
    border-bottom: none;
}

/* FORMULARIOS */
.form-group {
    margin-bottom: 16px;
}

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

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(137,81,93,.1);
}

/* TOASTS */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: #fff;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 11px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(35,30,31,.56);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    max-height: min(88vh, 900px);
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(20,16,18,.24);
}

.modal-header {
    padding: 20px 24px;
    background: #fcfbf9;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
}

/* PAGINA LOGIN */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: var(--dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}

.login-left h1 {
    font-size: 42px;
    color: var(--gold);
    margin-bottom: 16px;
}

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.login-card {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

/* BOTONES DE ACCIÓN EN TABLAS */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: #e0f5ea; color: var(--success); }
.badge-warning { background: #fff4d9; color: var(--warning); }
.badge-danger { background: #fde8ea; color: var(--danger); }
.badge-gray { background: #f1f1f1; color: var(--text-muted); }
.badge-gold { background: #f5eddf; color: #947044; }

/* Dashboard */
.dashboard-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 2px 0 27px; }
.dashboard-kicker { color: #9b7774; font-size: 9px; font-weight: 800; letter-spacing: 1.7px; }
.dashboard-intro h1 { margin-top: 6px; color: #302a2c; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(29px, 3vw, 38px); font-weight: 400; letter-spacing: -.7px; }
.dashboard-intro p { margin-top: 5px; color: var(--text-muted); font-size: 13px; }
.dashboard-date { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--border-color); border-radius: 9px; background: #fff; color: #706966; font-size: 11px; }
.dashboard-date i { color: #98656b; }
.dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 34px; }
.stat-card { display: flex; align-items: center; gap: 16px; min-height: 126px; }
.stat-icon { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px; font-size: 17px; }
.stat-rose { background: #f4e9e7; color: #98616a; }
.stat-gold { background: #f5efe5; color: #a17e4f; }
.stat-green { background: #eaf1eb; color: #64816b; }
.stat-label { color: #8a817c; font-size: 9px; font-weight: 800; letter-spacing: 1.15px; }
.stat-card h2 { margin: 1px 0 0; color: #302a2c; font-size: 29px; line-height: 1.25; font-weight: 700; }
.stat-caption { color: #918984; font-size: 10px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h3 { margin-top: 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 23px; font-weight: 400; letter-spacing: -.3px; }
.section-actions { display: flex; gap: 9px; }
.empty-state { padding: 46px 15px !important; text-align: center; color: var(--text-muted) !important; }
.empty-state > * { display: block; }
.empty-state-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: #f5efeb; color: #a27374; font-size: 17px; }
.empty-state strong { margin-bottom: 3px; color: #514947; font-size: 13px; }
.empty-state span:last-child { font-size: 11px; }

/* Consistencia para formularios y diálogos en todos los módulos */
.form-group { margin-bottom: 18px; }
.modal-header h3 { font-size: 16px; }
.modal-header button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #716966 !important; transition: background .18s; }
.modal-header button:hover { background: #f0ece9 !important; }
.modal-body .btn { min-height: 40px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #716966; cursor: pointer; }
.modal-close:hover { background: #f0ece9; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border-color); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(137,81,93,.28); outline-offset: 2px; }

/* ANIMACIONES */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .top-bar { min-height: 66px; gap: 12px; padding: 0 17px; }
    .top-bar h2 { flex: 1; font-size: 16px; }
    .user-profile { gap: 8px; }
    .user-info { display: none; }
    .page-container { padding: 20px 16px 28px; }
    .grid-container { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 13px; }
    .card { padding: 18px; }
    .table-wrapper { padding: 5px 13px 12px; }
    .modal-overlay { padding: 12px; }
    .modal-content { max-height: 94vh; }
    .modal-header, .modal-body { padding: 17px; }
    .modal-actions { padding: 14px 17px; }
    .dashboard-intro { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
    .dashboard-date { align-self: flex-start; }
    .dashboard-stats { grid-template-columns: 1fr; margin-bottom: 27px; }
    .stat-card { min-height: 96px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .section-actions { width: 100%; flex-wrap: wrap; }
    .section-actions .btn { flex: 1; justify-content: center; }
    .hamburger-btn {
        display: block;
    }
    .login-left {
        display: none;
    }
}

/* Agenda */
.appointments-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 2px 0 24px; }
.appointments-intro h1 { margin-top: 6px; color: #302a2c; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(29px, 3vw, 38px); font-weight: 400; letter-spacing: -.7px; }
.appointments-intro p { margin-top: 5px; color: var(--text-muted); font-size: 13px; }
.appointment-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 17px; padding: 13px 15px; border: 1px solid var(--border-color); border-radius: 13px; background: #fff; }
.appointment-filter { display: flex; align-items: center; gap: 9px; min-width: 225px; }
.appointment-filter > i { color: #9b6b70; font-size: 13px; }
.appointment-filter label { margin: 0; color: #716a66; font-size: 11px; white-space: nowrap; }
.appointment-filter input, .appointment-filter select { width: auto; min-width: 145px; height: 38px; padding: 7px 10px; border-color: #e9e2dd; border-radius: 8px; background: #fcfbfa; font-size: 12px; }
.appointment-hint { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #968c87; font-size: 10px; }
.appointment-hint i { color: #a77b78; }
.my-agenda-count { display: inline-flex; align-items: center; gap: 11px; min-width: 145px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 11px; background: #fff; color: #9b6b70; }
.my-agenda-count > i { font-size: 17px; }.my-agenda-count strong, .my-agenda-count small { display: block; }.my-agenda-count strong { color: #403537; font-size: 16px; line-height: 1.15; }.my-agenda-count small { margin-top: 2px; color: #918782; font-size: 9px; }
.appointments-table { min-width: 0; }
.appointments-table table { min-width: 760px; }
.appointment-row { cursor: pointer; }
.appointment-actions { white-space: nowrap; }
.appointment-actions .btn { width: 31px; height: 31px; justify-content: center; padding: 0; }
.appointments-empty { padding: 48px 15px !important; color: var(--text-muted); text-align: center; }
.appointments-empty i, .appointments-empty strong, .appointments-empty span { display: block; }
.appointments-empty i { margin-bottom: 10px; color: #a57978; font-size: 23px; }
.appointments-empty strong { color: #514947; font-size: 13px; }
.appointments-empty span { margin-top: 4px; font-size: 11px; }
.appointment-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.module-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 2px 0 23px; }
.module-intro h1 { margin-top: 6px; color: #302a2c; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(28px, 3vw, 37px); font-weight: 400; letter-spacing: -.65px; }
.module-intro p { margin-top: 5px; color: var(--text-muted); font-size: 13px; }
.module-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; margin-bottom: 15px; padding: 11px 14px; border: 1px solid var(--border-color); border-radius: 13px; background: #fff; }
.search-control { display: flex; align-items: center; gap: 10px; width: min(100%, 430px); height: 40px; margin: 0; padding: 0 12px; border: 1px solid #e9e2dd; border-radius: 9px; background: #fcfbfa; color: #9b7774; }
.search-control input { height: 100%; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none !important; font-size: 12px; }
.toolbar-hint, .toolbar-context { display: flex; align-items: center; gap: 9px; color: #918782; font-size: 10px; }
.toolbar-hint i { color: #a27676; }
.toolbar-context-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #f5eeea; color: #95646a; }
.toolbar-context strong, .toolbar-context small { display: block; }.toolbar-context strong { color: #5c504d; font-size: 11px; }.toolbar-context small { margin-top: 2px; color: #978e89; font-size: 10px; }
.records-table table { min-width: 720px; }
.records-table .record-row td:first-child strong { vertical-align: middle; }
.records-table .record-actions { white-space: nowrap; }
.records-table .record-actions .btn { margin: 2px; }
.muted-value { color: #a59c97; }
.icon-action { width: 32px; justify-content: center; padding: 6px !important; }
.user-cell-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: #f1e7e1; color: #80565d; font-size: 10px; font-weight: 800; vertical-align: middle; }
.permission-option { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; padding: 13px; border: 1px solid #e9e1dc; border-radius: 11px; background: #faf7f4; }
.permission-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #f0e5e0; color: #95636b; }
.permission-copy { flex: 1; }.permission-copy strong, .permission-copy small { display: block; }.permission-copy strong { color: #514441; font-size: 11px; }.permission-copy small { margin-top: 3px; color: #928783; font-size: 10px; line-height: 1.4; }
.permission-option input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--primary); }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.record-profile { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; padding: 15px; border: 1px solid #e9dfd9; border-radius: 12px; background: #faf6f3; }
.record-profile-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #ead9cf; color: #80555d; }
.record-profile small, .record-profile strong, .record-profile em { display: block; }.record-profile small { color: #a07875; font-size: 9px; font-weight: 800; letter-spacing: 1px; }.record-profile strong { margin-top: 2px; color: #3d3032; font-size: 16px; }.record-profile em { margin-top: 2px; color: #857975; font-size: 11px; font-style: normal; }
.record-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.record-facts > div { min-width: 0; padding: 11px; border: 1px solid #eee8e3; border-radius: 10px; background: #fff; }.record-facts small, .record-facts strong { display: block; }.record-facts small { color: #948983; font-size: 9px; }.record-facts strong { margin-top: 4px; color: #514744; font-size: 11px; overflow-wrap: anywhere; }
.record-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }.record-note { padding: 12px; border: 1px solid #eee7e2; border-radius: 10px; background: #fbf9f7; }.record-note:last-child { grid-column: 1 / -1; }.record-note > span { display: block; color: #765b5d; font-size: 10px; font-weight: 700; }.record-note > span i { margin-right: 5px; color: #a67975; }.record-note p { margin-top: 7px; color: #6e6560; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.record-history-heading { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 9px; }.record-history-heading small, .record-history-heading strong { display: block; }.record-history-heading small { color: #a07875; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }.record-history-heading strong { margin-top: 2px; color: #44383a; font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 400; }.record-history-heading > i { color: #a67975; }
.record-history-table { overflow-x: auto; }.record-history-table table { min-width: 500px; }
.empty-row td { padding: 45px 15px; color: var(--text-muted); text-align: center; }.empty-row i, .empty-row strong, .empty-row span { display: block; }.empty-row i { margin-bottom: 9px; color: #a67975; font-size: 22px; }.empty-row strong { color: #514947; font-size: 13px; }.empty-row span { margin-top: 4px; font-size: 11px; }
.users-table { overflow-x: hidden; }
.users-table table { width: 100%; min-width: 0; table-layout: fixed; }
.users-table th, .users-table td { padding-right: 8px; padding-left: 8px; overflow-wrap: anywhere; }
.users-table td[data-label="Agenda"] .btn { max-width: 100%; white-space: normal; }
.appointment-detail-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 13px; border: 1px solid #e9dfd9; border-radius: 11px; background: #faf6f3; }
.appointment-detail-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; background: #f0e3dd; color: #93636b; }
.appointment-detail-profile small, .appointment-detail-profile strong, .appointment-detail-profile em { display: block; }.appointment-detail-profile small { color: #9a7773; font-size: 9px; font-weight: 700; }.appointment-detail-profile strong { margin-top: 2px; color: #403537; font-size: 14px; }.appointment-detail-profile em { color: #8f8580; font-size: 10px; font-style: normal; }
.appointment-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.appointment-detail-grid > div { min-width: 0; padding: 10px; border: 1px solid #eee8e3; border-radius: 9px; background: #fff; }.appointment-detail-grid small, .appointment-detail-grid strong { display: block; }.appointment-detail-grid small, .appointment-detail-notes small { color: #978b85; font-size: 9px; }.appointment-detail-grid strong { margin-top: 3px; color: #554b47; font-size: 11px; overflow-wrap: anywhere; }
.appointment-detail-notes { margin-top: 9px; padding: 11px; border-radius: 9px; background: #faf8f6; }.appointment-detail-notes p { margin-top: 4px; color: #655b57; font-size: 11px; white-space: pre-wrap; }.appointment-state-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-color); }.appointment-state-section h4 { color: #514441; font-size: 12px; }.appointment-state-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 768px) {
    .module-intro { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
    .module-intro > .btn { width: 100%; justify-content: center; }
    .module-toolbar { align-items: stretch; flex-direction: column; }
    .search-control { width: 100%; }
    .toolbar-hint { align-self: flex-start; }
    .records-table { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .records-table table, .records-table tbody { display: block; width: 100%; min-width: 0; }
    .records-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
    .records-table tbody { display: grid; gap: 10px; }
    .records-table tbody tr.record-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(54,42,37,.035); }
    .records-table tbody tr.record-row td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 11px; }
    .records-table tbody tr.record-row td::before { display: block; margin-bottom: 3px; color: #998d87; content: attr(data-label); font-size: 8px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
    .records-table tbody tr.record-row td:nth-child(1), .records-table tbody tr.record-row td:nth-child(2) { grid-column: 1 / -1; }
    .records-table tbody tr.record-row td.record-actions { display: flex; justify-content: flex-end; gap: 6px; grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid #f0ebe7; }
    .records-table tbody tr.record-row td.record-actions::before { align-self: center; margin: 0 auto 0 0; }
    .records-table tbody tr:not(.record-row) { display: block; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
    .records-table tbody tr:not(.record-row) td { display: block; border: 0; }
    .dashboard-table { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .dashboard-table table, .dashboard-table tbody { display: block; width: 100%; min-width: 0; }
    .dashboard-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
    .dashboard-table tbody { display: grid; gap: 10px; }
    .dashboard-table tbody tr.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
    .dashboard-table tbody tr.dashboard-row td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 11px; }
    .dashboard-table tbody tr.dashboard-row td::before { display: block; margin-bottom: 3px; color: #998d87; content: attr(data-label); font-size: 8px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
    .dashboard-table tbody tr.dashboard-row td:nth-child(2), .dashboard-table tbody tr.dashboard-row td:nth-child(3) { grid-column: 1 / -1; }
    .dashboard-table tbody tr:not(.dashboard-row) { display: block; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
    .form-grid-two, .record-facts { grid-template-columns: 1fr; gap: 0; }
    .record-notes-grid { grid-template-columns: 1fr; }
    .record-note:last-child { grid-column: auto; }
    .toolbar-context small { max-width: 240px; }
    .appointments-intro { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
    .appointments-intro > .btn { width: 100%; justify-content: center; }
    .appointment-toolbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
    .appointment-filter { display: grid; grid-template-columns: 18px 1fr; min-width: 0; gap: 5px 8px; }
    .appointment-filter > i { grid-row: span 2; align-self: center; }
    .appointment-filter label { grid-column: 2; }
    .appointment-filter input, .appointment-filter select { grid-column: 2; width: 100%; min-width: 0; }
    .appointment-hint { margin: 2px 0 0; }
    .appointments-table { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .appointments-table table, .appointments-table tbody { display: block; width: 100%; min-width: 0; }
    .appointments-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
    .appointments-table tbody { display: grid; gap: 11px; }
    .appointments-table tbody tr.appointment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 13px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(54,42,37,.035); }
    .appointments-table tbody tr.appointment-row:hover { background: #fff; }
    .appointments-table tbody tr.appointment-row td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 12px; }
    .appointments-table tbody tr.appointment-row td::before { display: block; margin-bottom: 3px; color: #998d87; content: attr(data-label); font-size: 9px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
    .appointments-table tbody tr.appointment-row td:nth-child(2) { grid-column: 1 / -1; }
    .appointments-table tbody tr.appointment-row td:nth-child(3) { grid-column: 1 / -1; }
    .appointments-table tbody tr.appointment-row td.appointment-actions { display: flex; justify-content: flex-end; gap: 7px; grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid #f0ebe7; }
    .appointments-table tbody tr.appointment-row td.appointment-actions::before { align-self: center; margin: 0 auto 0 0; }
    .appointments-table tbody tr:not(.appointment-row) { display: block; padding: 17px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
    .appointments-table tbody tr:not(.appointment-row) td { display: block; border: 0; }
    .appointment-fields-row { grid-template-columns: 1fr; gap: 0; }
    .empty-state { display: block; }
    .personal-appointments tbody tr.appointment-row td:nth-child(2), .personal-appointments tbody tr.appointment-row td:nth-child(3) { grid-column: 1 / -1; }
    .my-agenda-count { align-self: flex-start; }
}

@media (min-width: 769px) and (max-width: 1400px) {
    .users-table { padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .users-table table, .users-table tbody { display: block; width: 100%; min-width: 0; }
    .users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
    .users-table tbody { display: grid; gap: 10px; }
    .users-table tbody tr.record-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
    .users-table tbody tr.record-row td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 11px; }
    .users-table tbody tr.record-row td::before { display: block; margin-bottom: 3px; color: #998d87; content: attr(data-label); font-size: 8px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
    .users-table tbody tr.record-row td:first-child, .users-table tbody tr.record-row td:last-child { grid-column: 1 / -1; }
    .users-table tbody tr.record-row td.record-actions { display: flex; justify-content: flex-end; gap: 6px; padding-top: 8px; border-top: 1px solid #f0ebe7; }
    .users-table tbody tr.record-row td.record-actions::before { align-self: center; margin: 0 auto 0 0; }
}
