﻿/* Desarrollado por Carlos Gonzalez */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #111827;
    --text-soft: #6b7280;
    --border: #dbe1ea;
    --primary: #1f3a5f;
    --primary-soft: #e8eef8;
    --danger: #b42318;
    --success: #0f766e;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.07);
    --radius: 12px;

    --color-noche: #1f3a5f;
    --color-madrugada: #31527d;
    --color-manana: #4f7a45;
    --color-tarde: #946100;
    --color-descanso: #6f5f24;
    --color-libre: #7f1d1d;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
    background: radial-gradient(1200px 480px at 100% -10%, #e8edf7 0%, transparent 62%), var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

main {
    flex: 1;
}

.container {
    max-width: 1360px;
}

header {
    background: linear-gradient(120deg, #1b3658, #2b4a72) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: clamp(1.4rem, 2.2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

header p {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
}

.header-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header .btn-light {
    border: 1px solid #cfd8e3;
    color: #1f2937;
    font-weight: 600;
    border-radius: 10px;
}

header .btn-light:hover {
    background: #f8fafc;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.card-body {
    padding: 1.4rem;
}

.card-title {
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #374151;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    min-height: 46px;
    font-size: 0.94rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #9db1cc;
    box-shadow: 0 0 0 0.2rem rgba(31, 58, 95, 0.12);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #172e4b;
    border-color: #172e4b;
}

.btn-outline-secondary {
    border-color: #c4ceda;
    color: #334155;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    color: #1f2937;
}

.stat-card {
    height: 100%;
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 1.2rem;
    text-align: left;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.stat-card h3 {
    font-size: 1.95rem;
    line-height: 1;
    margin: 0;
    font-weight: 800;
}

.stat-card p {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-card.turno-noche {
    background: #eef3fb;
    border-color: #d6e1f3;
    color: #1c3558;
}

.stat-card.turno-madrugada {
    background: #edf2f8;
    border-color: #d6deea;
    color: #304b72;
}

.stat-card.turno-mañana,
.stat-card.turno-maÃ±ana {
    background: #eef7ec;
    border-color: #d7e9d1;
    color: #365f2f;
}

.stat-card.turno-tarde {
    background: #fff6e7;
    border-color: #f4e2bc;
    color: #8a5e00;
}

.stat-card.turno-descanso {
    background: #f7f2e8;
    border-color: #e8dcc2;
    color: #665427;
}

.stat-card.turno-libre {
    background: #fdf0ef;
    border-color: #f5d3d1;
    color: #7f1d1d;
}

.turno-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
    overflow: hidden;
}

.turno-card:hover {
    border-color: #b8c7db;
    box-shadow: var(--shadow-md);
    transform: none;
}

.turno-header {
    margin-bottom: 0.75rem;
}

.badge-turno {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #334155;
    border: 1px solid #d7dfeb;
    background: #f8fafc;
}

.turno-info {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.turno-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.turno-info strong {
    color: #1f2937;
}

.turno-actions {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #ecf0f5;
    display: flex;
    gap: 0.5rem;
}

.turno-actions .btn {
    flex: 1;
    font-size: 0.84rem;
}

.turno-actions .btn-outline-primary {
    color: #1f3a5f;
    border-color: #b8c9df;
}

.turno-actions .btn-outline-primary:hover {
    color: #132742;
    border-color: #96aac8;
    background: #edf3fb;
}

.turno-actions .btn-outline-danger {
    color: #b42318;
    border-color: #efc8c5;
}

.turno-actions .btn-outline-danger:hover {
    color: #8e1c13;
    border-color: #dfa3a0;
    background: #fff3f2;
}

.table-responsive {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #dde5ef;
    color: #4b5563;
    background: #f8fafc;
    padding: 0.95rem 1rem;
}

.turno-tabla-row td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.turno-tabla-row:hover {
    background: #fafcff !important;
}

.turno-badge-noche,
.turno-badge-madrugada,
.turno-badge-mañana,
.turno-badge-tarde,
.turno-badge-descanso,
.turno-badge-libre {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.turno-badge-noche {
    color: #1c3558;
    background: #eaf0f8;
    border-color: #ccdaec;
}

.turno-badge-madrugada {
    color: #2d496f;
    background: #edf2f8;
    border-color: #d2dde9;
}

.turno-badge-mañana,
.turno-badge-maÃ±ana {
    color: #365f2f;
    background: #edf7eb;
    border-color: #d3e8ce;
}

.turno-badge-tarde {
    color: #855b00;
    background: #fff5e4;
    border-color: #f4e1b7;
}

.turno-badge-descanso {
    color: #675224;
    background: #f7f1e5;
    border-color: #e5d8bc;
}

.turno-badge-libre {
    color: #7f1d1d;
    background: #fdefee;
    border-color: #f4cecb;
}

.vista-btn,
.btn-outline-success,
.btn-outline-danger {
    border-radius: 9px;
    font-size: 0.88rem;
    border-width: 1px;
}

.vista-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-outline-success {
    color: var(--success);
    border-color: #9ed9d2;
}

.btn-outline-success:hover {
    color: #0f766e;
    background: #eefbf8;
    border-color: #81ccc3;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: #f3bfba;
}

.btn-outline-danger:hover {
    color: #9a1f16;
    background: #fff4f3;
    border-color: #e7a5a0;
}

.alert {
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: none;
    font-weight: 500;
}

.alert-info {
    color: #1f4f86;
    background: #edf5ff;
    border-color: #cddff6;
}

.alert-secondary {
    color: #374151;
    background: #f5f7fa;
    border-color: #e0e6ef;
}

.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.modal-content {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: #fff !important;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-soft) !important;
}

body.modo-oscuro {
    --bg: #111827;
    --surface: #1b2432;
    --surface-muted: #202c3e;
    --text: #f3f4f6;
    --text-soft: #c2c8d2;
    --border: #334155;
    --primary: #9db4d3;
    background: #0f172a;
}

body.modo-oscuro header {
    background: linear-gradient(120deg, #1e293b, #334155) !important;
}

body.modo-oscuro .card,
body.modo-oscuro .table-responsive,
body.modo-oscuro .modal-content,
body.modo-oscuro footer {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

body.modo-oscuro .table thead th {
    background: #202d3f;
    color: #d7deea;
    border-bottom-color: #324358;
}

body.modo-oscuro .turno-tabla-row td {
    border-bottom-color: #2b3a4e;
}

body.modo-oscuro .turno-tabla-row:hover {
    background: #202f42 !important;
}

body.modo-oscuro .form-control,
body.modo-oscuro .form-select {
    background: #1e293b;
    color: #e5e7eb;
    border-color: #364357;
}

body.modo-oscuro .text-muted {
    color: #aeb7c7 !important;
}

@media (max-width: 991px) {
    .turno-actions {
        flex-direction: column;
    }

    .turno-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.1rem;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    header .btn-light {
        width: auto;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .table thead th,
    .turno-tabla-row td {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
}
