* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
}

.topbar .brand { font-weight: 700; }

.topbar nav a {
    color: #d1d5db;
    text-decoration: none;
    margin-right: 16px;
}

.topbar nav a:hover { color: #fff; }

.topbar nav {
    display: flex;
    align-items: center;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 16px;
}

.nav-dropdown-toggle {
    margin-right: 0 !important;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 6px 0;
    min-width: 170px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 10;
}

.nav-dropdown-menu a {
    display: block;
    margin-right: 0;
    padding: 8px 14px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover { background: #374151; }

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.topbar .user a { color: #93c5fd; }

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.auth-box {
    max-width: 360px;
    margin: 60px auto;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.auth-box label, .card label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.auth-box input, .card input, .card select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover { background: #1d4ed8; }

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 20px;
}

.inline-form {
    display: flex;
    gap: 8px;
}

.inline-form input { width: auto; flex: 1; }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    white-space: nowrap;
}

th { background: #f9fafb; }

.sort-link {
    color: #1f2430;
    text-decoration: none;
    font-weight: 600;
}

.sort-link:hover { color: #2563eb; text-decoration: underline; }

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-whatsapp:hover { background: #1eb85c; }
.btn-whatsapp:disabled { opacity: .6; cursor: default; }

.btn-sms {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-sms:hover { background: #1d4ed8; }
.btn-sms:disabled { opacity: .6; cursor: default; }

.wa-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #25d366;
    margin-right: 6px;
    vertical-align: middle;
}

.wa-link:hover { color: #1eb85c; }

.whatsapp-enviado,
.sms-enviado {
    color: #1eb85c;
    font-weight: 700;
    font-size: 15px;
    display: block;
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.filters label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filters input[type="date"],
.filters input[type="text"],
.filters select {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: #1f2430;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    height: 38px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.filters select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
    cursor: pointer;
    min-width: 170px;
}

.filters input[type="date"]:hover,
.filters input[type="text"]:hover,
.filters select:hover {
    border-color: #9ca3af;
    background-color: #fff;
}

.filters input[type="date"]:focus,
.filters input[type="text"]:focus,
.filters select:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.filters button[type="submit"] {
    height: 38px;
    padding: 0 18px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.filters button[type="submit"]:hover { background: #1d4ed8; }

.badge {
    background: #eef2ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.alert { color: #b91c1c; }
.success { color: #15803d; }
.hint { color: #6b7280; font-size: 13px; }

.link-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.modal-box h2 {
    margin: 0 0 12px;
    font-size: 18px;
    padding-right: 24px;
}

.modal-box p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover { color: #1f2430; }

.modal-horarios {
    width: 100%;
    font-size: 13px;
}

.modal-horarios td {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 4px;
    white-space: normal;
}

.modal-horarios td:first-child {
    font-weight: 600;
    width: 90px;
}
