/* ========================================
   CircuitosQR - App Styles
   Modern, responsive design
   ======================================== */

:root {
    --primary: #1a56db;
    --primary-dark: #1242b0;
    --primary-light: #e8eefb;
    --success: #059669;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ---- Body ---- */
body {
    background-color: var(--gray-100);
    color: var(--gray-900);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar-app {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-sm);
}

.navbar-app .navbar-brand img {
    height: 40px;
}

.navbar-app .nav-link {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.navbar-app .nav-link:hover,
.navbar-app .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.navbar-app .dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: 0.25rem;
}

.navbar-app .dropdown-item {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
}

.navbar-app .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--gray-900);
}

/* ---- Buttons ---- */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
}

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

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

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

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

/* ---- Forms ---- */
.form-control,
.form-select {
    border-radius: var(--radius);
    border-color: var(--gray-300);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.3rem;
}

/* ---- Tables ---- */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
}

/* ---- Login ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.login-card .card-header {
    text-align: center;
    padding: 2rem 1.5rem 1rem;
    border: none;
    background: #fff;
}

.login-card .card-header img {
    height: 50px;
    margin-bottom: 0.5rem;
}

.login-card .card-body {
    padding: 1.5rem;
}

.login-card .btn-login {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
}

/* ---- Section Container ---- */
.section-container {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .section-container {
        padding: 1.5rem 2rem;
    }
}

/* ---- Filters Card ---- */
.filters .card-title {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ---- Clickable ---- */
.clickable {
    cursor: pointer;
}

/* ---- Responsive DataTables ---- */
.dataTables_wrapper {
    overflow-x: auto;
}

/* ---- Table Actions (mobile) ---- */
.table .actions {
    white-space: nowrap;
}

.table .actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    font-size: 1rem;
}

.table .actions a:hover {
    background: var(--gray-100);
}

/* ---- Public Page (ver_circuito) ---- */
.public-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.public-header img {
    height: 45px;
}

.circuito-ref-badge {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
}

@media (max-width: 576px) {
    .circuito-ref-badge {
        font-size: 1.1rem;
        padding: 0.75rem 1rem;
    }
}

.circuito-data {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.circuito-data h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
}

.circuito-data p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.linea-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: box-shadow 0.15s;
}

.linea-card:hover {
    box-shadow: var(--shadow);
}

.linea-card .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 576px) {
    .linea-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .linea-card .linea-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    .linea-card .linea-actions .btn {
        flex: 1;
    }
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ---- Not Found ---- */
.not-found {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--gray-500);
}

.not-found i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

/* ---- Toast Overrides ---- */
.toast-container {
    z-index: 9999;
}
