/**
 * Estilos Minimalistas para CMS
 * Sistema de Gestión de Establecimientos
 */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ea580c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --border-radius: 6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-layout {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 0;
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

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

.user-info {
    color: var(--gray-600);
    font-size: 13px;
}

/* Language Selector */
.language-selector {
    display: inline-block;
}

.language-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.language-dropdown:hover {
    border-color: var(--primary);
    background-color: var(--gray-50);
}

.language-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 15px;
}

.card-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-700);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-help {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-2 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

.col-3 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 10px;
}

.col-4 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 10px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    background: var(--gray-50);
}

.table td {
    font-size: 13px;
}

.table tr:hover {
    background: var(--gray-50);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Branch Blocks */
.branch-block {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    background: var(--gray-50);
    position: relative;
}

.branch-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.branch-block-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-900);
}

.btn-remove-branch {
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

input[type="file"].form-control {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--gray-300);
    background: white;
}

input[type="file"].form-control::file-selector-button {
    padding: 6px 12px;
    margin-right: 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--gray-200);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.text-center {
    text-align: center;
}

/* Establishment Card */
.establishment-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.establishment-card:last-child {
    border-bottom: none;
}

.establishment-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: var(--gray-100);
}

.establishment-info {
    flex: 1;
}

.establishment-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.establishment-meta {
    font-size: 12px;
    color: var(--gray-600);
}

.establishment-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Sidebar Filters */
.filter-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.filter-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    background: var(--gray-50);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.filter-content {
    padding: 10px;
}

.filter-item {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

.filter-item:hover {
    background: var(--gray-100);
}

.filter-item.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.filter-item .count {
    float: right;
    color: var(--gray-600);
    font-size: 12px;
}

.filter-item.active .count {
    color: rgba(255, 255, 255, 0.8);
}

.filter-clear {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--danger);
    text-decoration: none;
    border-top: 1px solid var(--gray-200);
}

.filter-clear:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    text-decoration: none;
    color: var(--gray-700);
    background: white;
}

.pagination a:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tooltip/Help */
.help-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--gray-300);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.help-tooltip:hover .help-icon {
    background: var(--primary);
}

.help-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.help-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--gray-900) transparent transparent transparent;
}

.help-tooltip:hover .help-content {
    visibility: visible;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .col-2,
    .col-3,
    .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .establishment-card {
        flex-direction: column;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        order: -1;
    }

    .help-content {
        white-space: normal;
        max-width: 200px;
    }
}
