/* Application Gestion Tickets - Responsive Styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --sidebar-width: 260px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

main {
    flex: 1;
}

/* Cards statistiques */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table responsive */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f1f3f5;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Mobile: cards instead of table rows */
@media (max-width: 767.98px) {
    .mobile-card {
        background: #fff;
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border-left: 4px solid var(--primary-color);
    }

    .mobile-card .card-title {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .mobile-card .card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 0;
        font-size: 0.875rem;
    }

    .mobile-card .card-row .label {
        color: #6c757d;
    }

    .mobile-card .card-actions {
        margin-top: 0.75rem;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .hide-mobile {
        display: none !important;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    h1, .h1 {
        font-size: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .page-header .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

/* Search bar */
.search-bar {
    max-width: 400px;
}

/* Badges */
.badge-credit {
    background-color: #fff3cd;
    color: #856404;
}

.badge-cash {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* Print ticket */
@media print {
    body * {
        visibility: hidden;
    }

    .ticket-print, .ticket-print * {
        visibility: visible;
    }

    .ticket-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 10mm;
    }

    .no-print {
        display: none !important;
    }
}

.ticket-print {
    max-width: 80mm;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.ticket-print .ticket-header {
    text-align: center;
    border-bottom: 2px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.ticket-print .ticket-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.ticket-print .ticket-total {
    border-top: 2px dashed #000;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
    font-size: 14px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Action buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Debt highlight */
.debt-row {
    background-color: #fff8e1 !important;
}

.debt-amount {
    color: var(--danger-color);
    font-weight: 600;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 575.98px) {
    .chart-container {
        height: 220px;
    }
}

/* Navbar mobile */
.navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin: 2px 0;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link i {
    margin-right: 0.35rem;
}

/* Card panels */
.panel-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.panel-card .card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Quick actions */
.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.quick-action .qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Page de connexion */
.login-page {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 50%, #084298 100%);
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
    width: 72px;
    height: 72px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: var(--primary-color);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.5rem;
    }

    #table-lignes thead {
        display: none;
    }

    #table-lignes .ligne-produit {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    #table-lignes .ligne-produit td {
        display: block;
        border: none;
        padding: 0.35rem 0;
    }

    #table-lignes .ligne-produit td:last-child {
        text-align: right;
    }

    #table-lignes tfoot tr {
        display: table-row;
    }
}

/* ===== LISTE PROFESSIONNELLE (style tableau) ===== */
.pro-navbar {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.pro-navbar .navbar-brand {
    font-size: 1.15rem;
    letter-spacing: 0.3px;
}


.pro-list-toolbar {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border-radius: 8px 8px 0 0;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pro-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.pro-toolbar-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.pro-date-field label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
    font-weight: 600;
}

.pro-date-field .form-control {
    min-width: 130px;
    border: none;
    font-size: 0.85rem;
}

.pro-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.pro-btn-new {
    font-weight: 600;
    padding: 0.35rem 1rem;
}

.pro-table-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.pro-table-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.pro-entries-wrap,
.pro-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #555;
}

.pro-entries-wrap .form-select {
    width: auto;
    min-width: 65px;
}

.pro-search-wrap .form-control {
    min-width: 160px;
}

.pro-table-scroll {
    max-height: none;
}

.pro-data-table {
    font-size: 0.875rem;
    border-collapse: collapse;
}

.pro-data-table thead th {
    background: #eceff1;
    color: #37474f;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid #cfd8dc;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.pro-data-table thead th:hover {
    background: #dfe6ea;
}

.pro-data-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.pro-data-table tbody tr.pro-data-row:hover {
    background-color: #f5f9ff;
}

.pro-data-table tbody tr.row-credit td {
    color: #c62828 !important;
    font-weight: 500;
}

.pro-data-table tbody tr.row-credit:hover {
    background-color: #ffebee;
}

.pro-data-table tfoot td {
    background: #eceff1;
    font-weight: 700;
    padding: 0.75rem;
    border-top: 2px solid #cfd8dc;
}

.pro-col-num {
    width: 45px;
    text-align: center;
    color: #78909c;
    font-weight: 600;
}

.pro-col-actions {
    width: 110px;
    text-align: center;
}

.pro-btn-actions {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
}

.pro-table-footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: #fafafa;
    border-top: 1px solid #eee;
    gap: 0.5rem;
}

.pro-table-info {
    font-size: 0.8rem;
}

.pro-mobile-list {
    display: none;
    padding: 0.75rem;
}

.pro-mobile-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.pro-mobile-card.row-credit-mobile {
    border-left-color: #c62828;
}

.pro-mobile-card .pmc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.pro-mobile-card .pmc-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.pro-mobile-card .pmc-num {
    background: #eceff1;
    color: #546e7a;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.pro-mobile-card .pmc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.2rem 0;
    gap: 0.5rem;
}

.pro-mobile-card .pmc-row .lbl {
    color: #888;
    flex-shrink: 0;
}

.pro-mobile-card .pmc-row .val {
    text-align: right;
    word-break: break-word;
}

.pro-mobile-card .pmc-actions {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #eee;
}

.pro-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #263238;
}

.pro-page-title i {
    color: var(--primary-color);
    margin-right: 0.35rem;
}

.pro-form-panel {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.pro-form-panel .pro-form-header {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.pro-form-panel .pro-form-body {
    padding: 1.25rem;
}

@media (max-width: 991.98px) {
    .pro-table-scroll {
        display: none;
    }

    .pro-mobile-list {
        display: block;
    }

    .pro-table-topbar .pro-search-wrap {
        width: 100%;
    }

    .pro-search-wrap .form-control {
        flex: 1;
        min-width: 0;
    }

    .pro-toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pro-list-toolbar {
        border-radius: 8px;
    }

    .pro-table-panel {
        border-radius: 8px;
        border-top: 1px solid #dee2e6;
        margin-top: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .pro-toolbar-dates {
        width: 100%;
    }

    .pro-date-field {
        flex: 1;
        min-width: 120px;
    }

    .pro-date-field .form-control {
        width: 100%;
        min-width: 0;
    }

    .pro-toolbar-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .pro-btn-new {
        flex: 1 1 100%;
    }
}

@media (min-width: 992px) {
    .pro-mobile-list {
        display: none !important;
    }
}

