/* Variables */
:root {
    --bg: #FAFAFC;
    --surface: #FFFFFF;
    --text: #DF6C87;
    --text-muted: #df6c87cc;
    --primary: #F22A6A;
    --primary-hover: #d41e5c;
    --border: #E3FAFC;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(242, 42, 106, .06);
    --shadow-md: 0 4px 16px rgba(242, 42, 106, .10);
    --danger: #dc2626;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --highlight: #FAFADD;
    --secondary: #DF6C87;
    --accent: #E3FAFC;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #FAFAFC 0%, #E3FAFC 50%, #FAFADD 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(242, 42, 106, .12);
    padding: 2.5rem 2rem;
    border: 1px solid #E3FAFC;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 160px;
    height: auto;
}

.login-header h1 {
    margin: 0 0 0.35rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.login-header p {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.15rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    background: var(--bg);
    color: #555;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--highlight);
    box-shadow: 0 0 0 3px rgba(242, 42, 106, .10);
}

.alert {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(242, 42, 106, .25);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--highlight);
    color: var(--primary);
}

.btn-excel {
    background: var(--secondary);
    color: #fff;
}

.btn-excel:hover {
    background: #c45a72;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Dashboard */
.dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.dashboard-header {
    background: var(--surface);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(242, 42, 106, .06);
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 3px solid var(--primary);
}

.dashboard-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-logo {
    height: 40px;
    width: auto;
    display: block;
}

.dashboard-partner {
    display: flex;
    align-items: center;
}

.dashboard-partner-logo {
    height: 28px;
    width: auto;
    display: block;
    opacity: 0.9;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-size: 0.9rem;
    color: var(--text);
}

.dashboard-main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Filters */
.filters-bar {
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

.filter-group input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg);
    color: #555;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--highlight);
    box-shadow: 0 0 0 3px rgba(242, 42, 106, .10);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Table */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: auto;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--accent);
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--highlight);
}

.data-table .sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.data-table .sort-link:hover {
    color: var(--primary-hover);
}

.data-table .sort-link.active::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.data-table .sort-link.active.asc::after {
    border-bottom: 5px solid var(--primary);
    border-top: none;
}

.data-table .sort-link.active.desc::after {
    border-top: 5px solid var(--primary);
    border-bottom: none;
}

.empty-cell {
    text-align: center;
    color: var(--text);
    padding: 2rem !important;
}

.table-count {
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text);
}

/* Paginación */
.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info .table-count {
    margin: 0;
}

.per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-form label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text);
}

.per-page-form select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    background: var(--bg);
    color: #555;
}

.per-page-form select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--highlight);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.pagination-num:hover:not(.current) {
    background: var(--highlight);
}

.pagination-num.current {
    background: var(--primary);
    color: #fff;
    cursor: default;
}

.pagination-ellipsis {
    padding: 0 0.25rem;
    font-size: 0.9rem;
    color: var(--text);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}
