/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Feather Icons - Minimalist SVG Icons */
/* Icons will be initialized via JavaScript */


/* CSS Variables - Apple-inspired Minimalist Design */
:root {
    /* Colors - Neutral Palette */
    --primary: #000000;
    --primary-hover: #1d1d1f;
    --secondary: #6e6e73;
    --accent: #0071e3;
    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #ff3b30;
    --background: #f5f5f7;
    --surface: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border: #d2d2d7;

    /* Shadows - Subtle */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Feather Icons Styling */
i[data-feather] {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
    margin-right: 6px;
}

h1 i[data-feather] {
    width: 28px;
    height: 28px;
    margin-right: 10px;
}

.btn i[data-feather] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.btn-small i[data-feather] {
    width: 14px;
    height: 14px;
    margin-right: 0;
}

.agenda-estado i[data-feather],
.agenda-pagado i[data-feather] {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    animation: fadeInUp 0.4s ease;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.98);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header */
header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
}

header nav {
    margin-left: auto;
}

header h1 {
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

header h1 i[data-feather] {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

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


/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: var(--surface);
    padding: 60px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: scaleIn 0.4s ease;
    border: 1px solid var(--border);
}

.login-box h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
}

.login-box h2 {
    color: var(--text-primary);
    margin-bottom: 40px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-links {
    margin-top: 20px;
}

.link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: var(--transition-base);
}

.link:hover {
    opacity: 0.7;
}

/* Messages */
.message {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    background: #d1f4e0;
    color: #0d5028;
    border: 1px solid #a7e9c5;
    font-weight: 500;
    animation: fadeInUp 0.3s ease;
}

.error-message {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    background: #ffe5e5;
    color: #c41e3a;
    border: 1px solid #ffb3b3;
    font-weight: 500;
    animation: fadeInUp 0.3s ease;
}

/* Forms */
.form-section {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.form-section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-client {
    display: grid;
    grid-template-columns: 2fr 130px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-notes {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-base);
    background: var(--surface);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.checkbox-label:hover {
    opacity: 0.7;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Radio Button Cards */
.radio-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    min-height: 90px;
}

.radio-card-content i[data-feather] {
    width: 28px;
    height: 28px;
    margin: 0;
    stroke-width: 2;
}

.radio-card-content span {
    font-weight: 500;
    font-size: 0.95em;
    color: var(--text-primary);
}

.radio-card:hover .radio-card-content {
    border-color: var(--primary);
    background: var(--background);
}

.radio-card input[type="radio"]:checked+.radio-card-content {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.radio-card input[type="radio"]:checked+.radio-card-content span {
    color: white;
}

.radio-card input[type="radio"]:checked+.radio-card-content i[data-feather] {
    stroke: white;
}

.radio-card input[type="radio"]:focus+.radio-card-content {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

.obrador-icon {
    width: 50px;
    height: 50px;
    margin: 0;
}

.cafeteria-icon {
    width: 50px;
    height: 50px;
    margin: 0;
    transform: scale(1.6);
}

.radio-card input[type="radio"]:checked+.radio-card-content .obrador-icon,
.radio-card input[type="radio"]:checked+.radio-card-content .cafeteria-icon {
    filter: brightness(0) invert(1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.95em;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-base);
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e8e8ed;
}

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

.btn-danger:hover {
    background: #e6342a;
}

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

.btn-success:hover {
    background: #28c249;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05em;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Productos Grid */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.producto-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    animation: fadeInUp 0.4s ease;
}

.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.producto-imagen {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.05);
}

.no-image {
    color: var(--text-secondary);
    font-size: 1.2em;
    font-weight: 500;
}

.producto-info {
    padding: 24px;
}

.producto-info h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 600;
}

.producto-info p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.producto-cantidad {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.producto-cantidad label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95em;
}

.cantidad-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-base);
}

.cantidad-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.producto-descripcion {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.producto-descripcion label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95em;
}

.descripcion-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    transition: all var(--transition-base);
}

.descripcion-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.descripcion-input::placeholder {
    color: var(--text-secondary);
}

.producto-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Producto Edit Row */
.producto-edit-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    align-items: end;
    transition: all var(--transition-base);
}

.producto-edit-row:hover {
    box-shadow: var(--shadow-sm);
}

/* Pedidos */
.pedidos-section {
    margin-bottom: 40px;
}

.pedidos-section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.pedidos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.pedido-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    background: var(--surface);
    transition: all var(--transition-base);
    animation: fadeInUp 0.4s ease;
}

.pedido-card.pendiente {
    border-left: 4px solid var(--warning);
}

.pedido-card.completado {
    border-left: 4px solid var(--primary);
}

.pedido-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.pedido-header h3 {
    color: var(--text-primary);
    font-size: 1.3em;
    font-weight: 600;
}

.pedido-fecha {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.pedido-body p {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.pedido-productos {
    background: var(--background);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.pedido-productos ul {
    list-style: none;
    margin-top: 10px;
}

.pedido-productos li {
    padding: 8px 0;
    color: var(--text-primary);
    white-space: pre-line;
    font-weight: 500;
}

.pedido-productos li:before {
    content: "• ";
    margin-right: 8px;
    color: var(--text-secondary);
}

.pedido-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Historial */
.historial-section {
    margin-bottom: 40px;
}

.historial-section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.historial-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.historial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    animation: fadeInUp 0.4s ease;
}

.historial-item:hover {
    box-shadow: var(--shadow-sm);
}

.historial-item.pendiente {
    border-left: 4px solid var(--warning);
}

.historial-item.completado {
    border-left: 4px solid var(--primary);
}

.historial-item.entregado {
    border-left: 4px solid var(--secondary);
    opacity: 0.85;
}

.historial-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.pedido-numero {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1em;
    min-width: 100px;
}

.pedido-fecha,
.pedido-cliente,
.pedido-telefono,
.pedido-productos-nombres,
.pedido-nota {
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
}

.pedido-productos-nombres {
    color: var(--success);
    font-weight: 600;
}

.pedido-nota {
    color: var(--accent);
    font-style: italic;
}

.pedido-pagado {
    font-weight: 600;
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.pedido-pagado.pagado-si {
    background: #d1f4e0;
    color: #0d5028;
}

.pedido-pagado.pagado-no {
    background: #ffe5e5;
    color: #c41e3a;
}

.pedido-importe {
    color: var(--success);
    font-weight: 700;
    font-size: 1em;
}

.historial-actions {
    display: flex;
    gap: 8px;
}

/* Agenda Date and Stats Container */
.agenda-date-stats-container {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    margin-bottom: 32px;
    gap: 16px;
    width: 100%;
}

.agenda-date-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
}

.date-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 100%;
    background: var(--background);
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 400;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.date-arrow:hover {
    background: var(--primary);
    color: white;
}

.date-arrow-left {
    border-right: 1px solid var(--border);
}

.date-arrow-right {
    border-left: 1px solid var(--border);
}

.agenda-date-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 32px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.agenda-date-day {
    font-size: 4em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    min-width: 80px;
    text-align: center;
    letter-spacing: -0.04em;
}

.agenda-date-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agenda-date-weekday {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

.agenda-date-month-year {
    font-size: 0.95em;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Agenda Stats */
.agenda-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex: 1;
}

.stat-card {
    background: var(--surface);
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-card.stat-pending {
    border-left: 4px solid var(--warning);
}

.stat-card.stat-completed {
    border-left: 4px solid var(--success);
}

.stat-card.stat-delivered {
    border-left: 4px solid var(--secondary);
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agenda-content {
    margin-top: 0;
    width: 100%;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    gap: 16px;
    animation: fadeInUp 0.4s ease;
    position: relative;
    /* Para los botones flotantes en desktop */
}

.agenda-item:hover {
    box-shadow: var(--shadow-sm);
}

.agenda-item.pendiente {
    border-left: 4px solid var(--warning);
}

.agenda-item.completado {
    border-left: 4px solid var(--primary);
}

.agenda-item.entregado {
    border-left: 4px solid var(--secondary);
    opacity: 0.85;
}

.agenda-item-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}



.agenda-row-1,
.agenda-row-2,
.agenda-row-3 {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.agenda-row-1 {
    font-weight: 600;
}

.agenda-row-2 {
    font-size: 0.9em;
}

.agenda-row-3 {
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.agenda-numero {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05em;
    min-width: 100px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--background);
}

.agenda-fecha,
.agenda-cliente,
.agenda-telefono,
.agenda-location,
.agenda-productos,
.agenda-nota,
.agenda-importe {
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
}

.agenda-item-info i[data-feather] {
    width: 11px;
    height: 11px;
    margin-right: 3px;
}

.agenda-location {
    color: var(--accent);
    font-weight: 600;
}

.agenda-productos {
    color: var(--success);
    font-weight: 600;
}

.agenda-nota {
    color: var(--accent);
    font-style: italic;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-nota-full {
    color: var(--accent);
    font-style: italic;
    width: 100%;
    white-space: normal;
    line-height: 1.5;
}

.agenda-estado {
    font-weight: 600;
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agenda-estado i[data-feather],
.agenda-pagado i[data-feather],
.agenda-productos i[data-feather] {
    width: 11px;
    height: 11px;
    margin-right: 3px;
}

.agenda-estado.pendiente {
    background: #fff3cd;
    color: #856404;
}

.agenda-estado.completado {
    background: #e3ebf6;
    color: var(--primary);
}

.agenda-estado.entregado {
    background: var(--background);
    color: var(--text-secondary);
}

.agenda-pagado {
    font-weight: 600;
    font-size: 0.85em;
    padding: 6px 12px;
    border-radius: var(--radius-full);
}

.agenda-pagado.pagado-si {
    background: #d1f4e0;
    color: #0d5028;
}

.agenda-pagado.pagado-no {
    background: #ffe5e5;
    color: #c41e3a;
}

.agenda-importe {
    color: var(--success);
    font-weight: 700;
    font-size: 1em;
}

.agenda-item-actions {
    display: flex;
    gap: 8px;
}

.no-products,
.no-pedidos {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    font-size: 1.1em;
    background: var(--background);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.auto-refresh {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 32px;
    }

    .agenda-date-stats-container {
        flex-direction: column;
        gap: 20px;
    }

    .agenda-date-box {
        width: 100%;
        justify-content: center;
    }

    .agenda-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .stat-number {
        font-size: 2em;
    }

    .stat-label {
        font-size: 0.8em;
    }

    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pedidos-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 24px;
    }

    header {
        flex-wrap: wrap;
        gap: 16px;
        align-items: center;
    }

    header h1 {
        font-size: 1.3em;
    }

    nav {
        width: 100%;
        flex-direction: column;
        margin-left: 0;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-card-content {
        flex-direction: row;
        justify-content: flex-start;
        min-height: auto;
        padding: 16px;
    }

    .radio-card-content i[data-feather] {
        width: 20px;
        height: 20px;
    }

    .obrador-icon {
        width: 32px;
        height: 32px;
    }

    .cafeteria-icon {
        width: 32px;
        height: 32px;
        transform: scale(1.6);
    }

    .productos-grid,
    .pedidos-list {
        grid-template-columns: 1fr;
    }

    .form-row,
    .form-row-client,
    .form-row-notes {
        grid-template-columns: 1fr;
    }

    .producto-edit-row {
        grid-template-columns: 1fr;
    }

    .historial-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .historial-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .historial-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .agenda-header {
        flex-direction: column;
    }

    .agenda-date-stats-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .agenda-date-box {
        width: 100%;
        justify-content: center;
    }

    .date-arrow {
        width: 60px;
        font-size: 1.6em;
    }

    .agenda-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .agenda-date-display {
        width: 100%;
        justify-content: center;
    }

    .agenda-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .agenda-row-1,
    .agenda-row-2,
    .agenda-row-3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .agenda-item-info {
        width: 100%;
    }

    .agenda-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .agenda-nota {
        max-width: 100%;
        white-space: normal;
    }

    .login-box {
        padding: 40px 30px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* =============================================
   Mini Calendario Mensual (agenda.php)
   ============================================= */
.mini-cal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    max-width: 380px;
}

.mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mini-cal-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-transform: capitalize;
}

.mini-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.4em;
    line-height: 1;
    transition: all var(--transition-base);
}

.mini-cal-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.mini-cal-dow {
    text-align: center;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 8px;
}


.mini-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-base);
    gap: 1px;
    line-height: 1;
}

.mini-cal-day:hover {
    background: var(--background);
    color: var(--primary);
}

/* Hoy */
.mini-cal-day.hoy {
    background: rgba(0, 113, 227, 0.1);
    color: var(--primary);
    font-weight: 700;
}

/* Día seleccionado */
.mini-cal-day.sel {
    background: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35);
}

.mini-cal-day.sel:hover {
    background: var(--primary-hover);
    color: white;
}

/* Badge de pedidos */
.mini-cal-dot {
    display: block;
    font-size: 0.6em;
    font-weight: 700;
    background: var(--warning);
    color: #fff;
    border-radius: 9px;
    min-width: 14px;
    padding: 0 3px;
    text-align: center;
    line-height: 14px;
    height: 14px;
}

.mini-cal-day.sel .mini-cal-dot {
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary);
}

/* Día con nota guardada */
.mini-cal-day.tiene-nota::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    margin: 1px auto 0;
}

/* =============================================
   Wrapper Calendario + Notas del Día
   ============================================= */
.cal-notes-wrapper {
    display: flex;
    gap: 16px;
    align-items: stretch;
    /* Se estiran para igualar alto */
    margin-bottom: 28px;
    width: 100%;
}

/* El .mini-cal dentro del wrapper pierde su propio margen inferior */
.cal-notes-wrapper .mini-cal {
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.cal-notes-wrapper .mini-cal-grid {
    flex: 1;
    /* Ocupa el espacio extra si lo hay */
}

/* =============================================
   Notas del Día
   ============================================= */
.notas-dia {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notas-dia-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.notas-dia-header i[data-feather] {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.notas-textarea {
    flex: 1;
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--background);
    resize: vertical;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    line-height: 1.6;
    box-sizing: border-box;
}

.notas-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.notas-textarea::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.notas-dia-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.notas-status {
    font-size: 0.85em;
    font-weight: 500;
    transition: color var(--transition-base);
}

.notas-status.saving {
    color: var(--text-secondary);
}

.notas-status.saved {
    color: var(--success);
}

.notas-status.error {
    color: var(--danger);
}

/* Responsive: apila en pantallas pequeñas */
@media (max-width: 700px) {
    .cal-notes-wrapper {
        flex-direction: column;
    }

    .cal-notes-wrapper .mini-cal {
        max-width: 100%;
        width: 100%;
    }
}

/* =========================================================
   IMPRESIÓN (@media print) — agenda.php
   ========================================================= */
@media print {

    /* Ocultar elementos innecesarios */
    header,
    nav,
    .agenda-filtros,
    .cal-notes-wrapper,
    .date-nav,
    .agenda-stats,
    .auto-refresh,
    .agenda-item-actions,
    .print-btn {
        display: none !important;
    }

    /* Ajustes generales de página */
    body {
        margin: 0;
        padding: 0;
        background: white;
        font-size: 11pt;
    }

    .container {
        box-shadow: none;
        padding: 10px;
        max-width: 100%;
        margin: 0;
    }

    /* Lista de pedidos en modo bloque */
    .agenda-list {
        display: block;
    }

    /* Cada pedido intenta no cortarse entre páginas */
    .agenda-item {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #bbb !important;
        margin-bottom: 12px;
        padding: 10px 14px;
    }

    /* Asegurar que los colores de las etiquetas se impriman */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ---- Botón activo de navegación (página actual) ---- */
.btn-active,
.btn-active:hover,
a.btn-active,
a.btn-active:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    filter: none !important;
}

/* Forzar iconos SVG blancos dentro del botón activo */
.btn-active img {
    filter: brightness(0) invert(1) !important;
}

/* ---- Botón flotante de Guía de Uso ---- */
.floating-info-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1d1d1f;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 9999;
    animation: floatBtnIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes floatBtnIn {
    from { opacity: 0; transform: scale(0.6) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.floating-info-btn:hover {
    background: #3a3a3c;
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.floating-info-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tooltip */
.floating-info-btn::before {
    content: 'Guía de Uso';
    position: absolute;
    right: 62px;
    top: 50%;
    transform: translateY(-50%);
    background: #1d1d1f;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82em;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s 0.1s;
    font-family: 'Inter', sans-serif;
}

.floating-info-btn::after {
    content: '';
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1d1d1f;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s 0.1s;
}

.floating-info-btn:hover::before,
.floating-info-btn:hover::after {
    opacity: 1;
}

@media print {
    .floating-info-btn { display: none !important; }
}

/* ---- Menú lateral (burger) ---- */
.burger-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.burger-btn:hover {
    box-shadow: var(--shadow-lg);
}

.burger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.burger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.open span:nth-child(2) {
    opacity: 0;
}

.burger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast);
    z-index: 1300;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    z-index: 1400;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.side-menu-logo {
    height: 40px;
    width: auto;
}

.side-menu-close {
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.side-menu-close:hover {
    background: var(--background);
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 4px;
}

.side-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.side-menu-link:hover {
    background: var(--background);
}

.side-menu-link.active {
    background: var(--primary);
    color: #fff;
}

.side-menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.side-menu-link.active .side-menu-icon {
    filter: brightness(0) invert(1);
}

.side-menu-logout {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    color: var(--danger);
}

@media print {
    .burger-btn,
    .side-menu-overlay,
    .side-menu { display: none !important; }
}
