/**
 * HostFinance - Estilos Principais
 * Tema: Azul claro + Branco + Cinza suave
 * 
 * Breakpoints usados no projeto:
 * - xs: 0 - 480px (celulares pequenos)
 * - sm: 481px - 576px (celulares grandes)
 * - md: 577px - 768px (tablets portrait)
 * - lg: 769px - 992px (tablets landscape / laptops pequenos)
 * - xl: 993px - 1200px (laptops / monitores pequenos)
 * - xxl: 1201px+ (monitores grandes)
 */

/* ==================== VARIÁVEIS ==================== */
:root {
    /* Cores principais */
    --primary-color: #0d6efd;
    --primary-light: #3d8bfa;
    --primary-dark: #0a58ca;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Cores de fundo */
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    
    /* Cores de texto */
    --text-color: #333333;
    --text-muted: #6c757d;
    
    /* Dimensões */
    --navbar-height: 70px;
    --sidebar-width: 250px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    
    /* Espaçamentos (baseados em múltiplos de 4px) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    
    /* Larguras utilitárias */
    --w-80: 80px;
    --w-100: 100px;
    --w-120: 120px;
    --w-150: 150px;
    --w-200: 200px;
    
    /* Transições */
    --transition: all 0.3s ease;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== LAYOUT ==================== */
.navbar-fixed {
    padding-top: var(--navbar-height);
}

.main-content {
    min-height: calc(100vh - var(--navbar-height));
    padding: 30px 0;
}

/* ==================== NAVBAR ==================== */
.navbar {
    height: var(--navbar-height);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand img {
    height: 35px;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    margin-top: 10px;
}

.dropdown-item {
    padding: 10px 20px;
    border-radius: 5px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ==================== CARDS ==================== */
/* Componente: card */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: var(--card-bg);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.card--hover:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.card--border {
    border: 1px solid var(--border-color);
}

.card--border-danger {
    border: 2px solid var(--danger-color);
}

.card__header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 15px 20px;
}

.card__body {
    padding: 20px;
}

.card__footer {
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
}

.card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Card com scroll no body */
.card--scroll .card__body {
    max-height: 400px;
    overflow-y: auto;
}

/* ==================== STATS CARDS ==================== */
/* Componente: stats-cards (container) */
.stats-cards {
    display: grid;
    gap: var(--space-md);
}

/* Componente: stat-card */
.stat-card {
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Ícone do stat-card - garantir centralização */
.stat-card .stat-icon,
.stat-card__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px !important;
    font-size: 24px;
    text-align: center;
    float: none !important;
}

.stat-card .stat-value,
.stat-card__value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    display: block;
    text-align: center;
}

.stat-card .stat-label,
.stat-card__label {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    text-align: center;
}

/* Dashboard Stats - Garante 4 cards por linha no desktop */
.dashboard-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.dashboard-stats > [class*="col-"] {
    flex: 0 0 25% !important;
    max-width: 25% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Override para 5 cards na mesma linha em telas grandes (1200px+) */
@media (min-width: 1200px) {
    .dashboard-stats.dashboard-stats-5 > div[class*="col-"] {
        flex: 0 0 20% !important;
        max-width: 20% !important;
    }
}

/* Override para dispositivos menores */
@media (max-width: 991.98px) {
    .dashboard-stats > [class*="col-"] {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

@media (max-width: 575.98px) {
    .dashboard-stats > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ==================== TABLES ==================== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* ==================== BADGES ==================== */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: 20px;
}

.badge-primary { background-color: var(--primary-color); }
.badge-success { background-color: var(--success-color); }
.badge-warning { background-color: var(--warning-color); color: #000; }
.badge-danger { background-color: var(--danger-color); }
.badge-info { background-color: var(--info-color); color: #000; }
.badge-secondary { background-color: var(--secondary-color); }
.badge-dark { background-color: var(--dark-color); }

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

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

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

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

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

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

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

.btn-sm {
    padding: 5px 15px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* ==================== FORMS ==================== */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

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

.form-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 15px;
}

/* ==================== MODALS ==================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 25px;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 25px;
}

/* ==================== ALERTS ==================== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 15px 20px;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* ==================== PAGINATION ==================== */
.pagination {
    margin: 0;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== SIDEBAR (Admin only) ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.sidebar-menu-item.active {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    padding-top: var(--navbar-height);
}

/* ==================== LOGIN/REGISTER ==================== */
.auth-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    max-width: 100%;
    height: auto;
}

.auth-logo h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

.auth-logo p {
    color: var(--text-muted);
    margin-top: 5px;
}

/* Mobile auth adjustments */
@media (max-width: 480px) {
    .auth-container {
        padding: 15px;
        align-items: flex-start;
        padding-top: 30px;
    }
    
    .auth-card {
        padding: 25px 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    .auth-logo {
        margin-bottom: 20px;
    }
    
    .auth-logo img {
        max-height: 50px;
    }
    
    .auth-logo h1 {
        font-size: 1.5rem;
    }
    
    .auth-logo p {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .auth-container {
        padding: 10px;
        padding-top: 20px;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
}

/* ==================== DASHBOARD ==================== */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.dashboard-welcome h2 {
    margin-bottom: 10px;
}

/* ==================== ORDER/PRODUCT CARDS ==================== */
.plan-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    background: white;
    height: 100%;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.plan-card.featured {
    border-color: var(--primary-color);
    position: relative;
}

.plan-card.featured::before {
    content: 'Mais Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0;
}

.plan-price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.plan-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features i {
    color: var(--success-color);
    margin-right: 10px;
}

/* ==================== INVOICE ==================== */
.invoice-container {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.invoice-table {
    width: 100%;
    margin-bottom: 30px;
}

.invoice-table th {
    background: var(--light-color);
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.invoice-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* ==================== TICKET ==================== */
.ticket-list {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.ticket-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.ticket-item:hover {
    background: var(--light-color);
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-subject {
    font-weight: 600;
    margin-bottom: 5px;
}

.ticket-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ticket-messages {
    background: white;
    border-radius: var(--border-radius);
}

.ticket-message {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.ticket-message.admin {
    background: rgba(13, 110, 253, 0.05);
}

.ticket-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.ticket-message-content {
    line-height: 1.8;
}

/* ==================== PRICING TABLES ==================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* ==================== FOOTER ==================== */
.footer {
    background: white;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-text {
    text-align: center;
    color: var(--text-muted);
}

/* ==================== UTILITIES ==================== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

/* Larguras fixas utilitárias */
.w-80 { width: var(--w-80) !important; }
.w-100 { width: var(--w-100) !important; }
.w-120 { width: var(--w-120) !important; }
.w-150 { width: var(--w-150) !important; }
.w-200 { width: var(--w-200) !important; }

/* Max-widths */
.max-w-200 { max-width: var(--w-200) !important; }
.max-w-250 { max-width: 250px !important; }
.max-w-300 { max-width: 300px !important; }
.max-w-400 { max-width: 400px !important; }

/* Alturas fixas */
.h-200 { height: 200px !important; }
.h-300 { height: 300px !important; }
.h-400 { height: 400px !important; }

/* Overflow */
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-scroll { overflow: scroll !important; }
.overflow-y-auto { overflow-y: auto !important; }

/* Espaçamentos usando variáveis */
.gap-1 { gap: var(--space-xs) !important; }
.gap-2 { gap: var(--space-sm) !important; }
.gap-3 { gap: var(--space-md) !important; }
.gap-4 { gap: var(--space-lg) !important; }
.gap-5 { gap: var(--space-xl) !important; }

/* Margin usando variáveis */
.mt-2 { margin-top: var(--space-sm) !important; }
.mt-3 { margin-top: var(--space-md) !important; }
.mt-4 { margin-top: var(--space-lg) !important; }
.mt-5 { margin-top: var(--space-xl) !important; }

.mb-2 { margin-bottom: var(--space-sm) !important; }
.mb-3 { margin-bottom: var(--space-md) !important; }
.mb-4 { margin-bottom: var(--space-lg) !important; }
.mb-5 { margin-bottom: var(--space-xl) !important; }

/* Padding usando variáveis */
.p-2 { padding: var(--space-sm) !important; }
.p-3 { padding: var(--space-md) !important; }
.p-4 { padding: var(--space-lg) !important; }
.p-5 { padding: var(--space-xl) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.rounded { border-radius: var(--border-radius) !important; }
.shadow-sm { box-shadow: var(--box-shadow) !important; }
.shadow { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important; }
.shadow-lg { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.d-grid { display: grid !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-1 { flex: 1 !important; }

.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* Opacity */
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

/* Border */
.border { border: 1px solid var(--border-color) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.border-danger { border-color: var(--danger-color) !important; }
.border-success { border-color: var(--success-color) !important; }

/* Text truncate */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Position */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-static { position: static !important; }

/* Z-index */
.z-1 { z-index: 1 !important; }
.z-10 { z-index: 10 !important; }
.z-100 { z-index: 100 !important; }
.z-1000 { z-index: 1000 !important; }

/* ==================== ADMIN RESPONSIVE STYLES ==================== */

/* Admin Layout - Desktop */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background-color: #1a237e !important;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: 60px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Mobile Header */
.admin-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #1a237e;
    color: white;
    z-index: 101;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
}

.admin-mobile-header .btn {
    padding: 8px 12px;
}

/* Sidebar Overlay */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Responsive Breakpoints */

/* Tablet and below */
@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 0px;
        --navbar-height: 60px;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-mobile-header {
        display: flex;
    }
    
    .admin-main {
        padding-top: 70px;
    }
    
    /* Adjust content wrapper for mobile */
    .content-wrapper {
        padding-top: 70px !important;
    }
}

/* Small tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
    .admin-sidebar {
        width: 260px;
    }
}

/* Mobile phones */
@media (max-width: 767.98px) {
    :root {
        --navbar-height: 56px;
    }
    
    .admin-main {
        padding-top: 60px;
    }
    
    .content-wrapper {
        padding-top: 60px !important;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .admin-mobile-header {
        padding: 0 10px;
    }
    
    .admin-mobile-header .navbar-brand img {
        max-height: 20px;
    }
}

/* ==================== RESPONSIVE ==================== */

/* Extra Small (celulares menores) */
@media (max-width: 360px) {
    :root {
        --navbar-height: 56px;
    }
    
    body {
        font-size: 13px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-card .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }
    
    .card {
        border-radius: 6px;
    }
    
    .card-body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 56px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .main-content {
        padding: 15px 0;
    }
    
    body {
        font-size: 13px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .form-control, .form-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.05rem; }
    
    .card-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    .card-header .btn {
        align-self: flex-end;
    }
    
    .stat-card {
        padding: 15px 10px;
    }
    
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-card .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
    
    .dashboard-welcome {
        padding: 20px 15px;
    }
    
    .dashboard-welcome h2 {
        font-size: 1.3rem;
    }
    
    .dashboard-welcome .btn {
        margin-top: 10px;
        width: 100%;
    }
    
    .auth-card {
        padding: 20px 15px;
        margin: 15px;
    }
    
    .plan-price {
        font-size: 1.75rem;
    }
    
    .modal {
        padding: 5px;
    }
    
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .dropdown-menu {
        position: absolute !important;
        width: 100%;
        min-width: 180px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 10px 8px;
    }
    
    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 500px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .footer {
        padding: 20px 0;
    }
    
    .footer h5 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .footer p, .footer a {
        font-size: 0.85rem;
    }
}

/* Tablets Portrait */
@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }
    
    .container {
        max-width: 95%;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .table-responsive table {
        min-width: 550px;
    }
}

/* Tablets Landscape & Small Laptops */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
}

/* Laptops & Desktops */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    :root {
        --navbar-height: 60px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Navbar Mobile */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand img {
        max-height: 28px;
    }
    
    .navbar-toggler {
        padding: 4px 8px;
    }
    
    .mobile-menu-btn {
        font-size: 1.5rem;
    }
    
    .navbar-collapse {
        background: var(--card-bg);
        padding: 15px;
        margin-top: 10px;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        margin-top: 10px;
    }
    
    .nav-item {
        margin: 5px 0;
    }
    
    .nav-link {
        padding: 10px 15px !important;
        border-radius: var(--border-radius);
    }
    
    .nav-link:hover {
        background: var(--light-color);
    }
    
    .dropdown-menu {
        border: 1px solid var(--border-color);
        margin-top: 5px;
        padding: 5px;
    }
    
    .dropdown-item {
        padding: 10px 15px;
        border-radius: 5px;
    }
    
    /* Page Headers */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* Filters */
    .filters-form .col-md-2,
    .filters-form .col-md-3,
    .filters-form .col-md-4,
    .filters-form .col-md-6 {
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .auth-card {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .dashboard-welcome {
        padding: 20px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
    }
    
    /* Filter buttons horizontal scroll */
    .btn-group-filter {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        gap: 8px;
    }
    
    .btn-group-filter .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    /* Form filters */
    .filter-form .col-md-2,
    .filter-form .col-md-3,
    .filter-form .col-md-4 {
        margin-bottom: 10px;
    }
    
    /* Invoice details */
    .invoice-container {
        padding: 20px;
    }
    
    .invoice-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    /* Ticket list mobile */
    .ticket-list .ticket-item {
        padding: 15px;
    }
    
    .ticket-subject {
        font-size: 0.95rem;
    }
    
    /* Cards */
    .plan-card {
        padding: 20px;
    }
    
    .plan-name {
        font-size: 1.25rem;
    }
    
    .plan-price {
        font-size: 2rem;
    }
    
    /* Page title */
    .page-header h2 {
        margin-bottom: 5px;
    }
    
    .page-header .text-muted {
        font-size: 0.85rem;
    }
    
    /* Action buttons */
    .action-buttons {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }
}

/* Very Small Devices */
@media (max-width: 400px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        max-height: 24px;
    }
    
    .mobile-menu-btn {
        font-size: 1.3rem;
    }
    
    .card {
        border-radius: 6px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-header {
        padding: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .form-control, .form-select {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
    h5 { font-size: 0.9rem; }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    
    .dashboard-welcome {
        padding: 15px;
    }
    
    .dashboard-welcome h2 {
        font-size: 1.2rem;
    }
    
    .dashboard-welcome p {
        font-size: 0.85rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px 6px;
    }
    
    .badge {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .dropdown-toggle::after {
        display: inline-block;
    }
    
    .dropdown-menu {
        min-width: 160px;
    }
    
    /* Smaller icons */
    .bi {
        font-size: 0.9em;
    }
    
    /* Invoice badges */
    .invoice-amount {
        font-size: 0.9rem;
    }
    
    .invoice-date {
        font-size: 0.8rem;
    }
    
    /* Ticket details */
    .ticket-message {
        padding: 12px;
    }
    
    .ticket-message-header {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-in-up {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Button Hover Animations */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

/* Card Animations */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-md {
    width: 35px;
    height: 35px;
    border-width: 3px;
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 10000;
    max-width: 350px;
    margin: 0 auto;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    word-break: break-word;
}

.toast-success {
    background: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.toast-error {
    background: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.toast-warning {
    background: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.toast-info {
    background: #cff4fc;
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

.toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 5px;
}

.toast-close:hover {
    opacity: 1;
}

/* Mobile toast adjustments */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Form Validation */
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

.was-validated .form-control:invalid {
    border-color: var(--danger-color);
}

.was-validated .form-control:valid {
    border-color: var(--success-color);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* Table card wrapper for mobile */
.table-card {
    position: relative;
}

/* Mobile Card View for Tables */
@media (max-width: 768px) {
    .table-card .table thead {
        display: none;
    }
    
    .table-card .table, 
    .table-card .table tbody, 
    .table-card .table tr, 
    .table-card .table td {
        display: block;
        width: 100%;
    }
    
    .table-card .table tbody tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        background: white;
    }
    
    .table-card .table tbody td {
        padding: 10px 15px;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }
    
    .table-card .table tbody td:last-child {
        border-bottom: none;
        text-align: center;
    }
    
    .table-card .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
    
    .table-card .table tbody td[data-label="Status"]::before,
    .table-card .table tbody td[data-label="Ações"]::before {
        display: none;
    }
}

/* Action Buttons Responsive */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Invoice Edit Actions - Mobile Layout */
.invoice-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.invoice-edit-actions .row {
    margin: 0;
}

.invoice-edit-actions .col-6 {
    padding: 0 5px;
}

.invoice-edit-actions .btn {
    white-space: nowrap;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .invoice-edit-actions {
        flex-direction: row;
        width: auto;
        gap: 8px;
    }
    
    .invoice-edit-actions .mobile-buttons {
        display: none;
    }
    
    .invoice-edit-actions .desktop-buttons {
        display: flex !important;
        gap: 10px;
    }
    
    .invoice-edit-actions .desktop-buttons .btn {
        margin-bottom: 0;
    }
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.action-buttons .btn i {
    font-size: 0.9rem;
}

/* Mobile card view - align actions to left */
@media (max-width: 768px) {
    .table-card .table tbody td[data-label="Ações"] {
        text-align: left !important;
        padding-top: 12px;
    }
    
    .table-card .table tbody td[data-label="Ações"]::before {
        display: none;
    }
    
    .table-card .table tbody td:first-child {
        padding-left: 15px;
    }
    
    /* Dropdown mobile fix */
    .table-card .dropdown .dropdown-menu {
        max-width: 180px;
        position: absolute;
        right: 0;
        left: auto;
    }
    
    .table-card .dropdown .btn.dropdown-toggle {
        padding: 4px 8px;
        min-width: auto;
        width: auto;
    }
    
    .table-card .dropdown .btn.dropdown-toggle::after {
        display: inline-block;
        margin-left: 4px;
    }
    
    /* Modal buttons mobile */
    .modal-footer .btn,
    .d-grid .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .modal-footer .btn:last-child,
    .d-grid .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Form buttons mobile - client_add.php */
    .col-12 .d-grid.gap-2 {
        display: flex;
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .col-12 .d-grid.gap-2 .btn {
        width: 100%;
        margin-bottom: 0;
    }
    
    @media (min-width: 768px) {
        .col-12 .d-grid.gap-2 {
            flex-direction: row;
        }
        
        .col-12 .d-grid.gap-2 .btn {
            width: auto;
        }
    }
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: row;
        gap: 3px;
    }
    
    .action-buttons .btn {
        padding: 4px 6px;
    }
}

/* Page Header Responsive */
.page-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn {
        width: 100%;
    }
}

/* Filters Responsive */
.filters-form .row,
.filter-form .row {
    --bs-gutter-x: 1rem;
}

@media (max-width: 768px) {
    .filters-form .col-md-2,
    .filters-form .col-md-3,
    .filters-form .col-md-4,
    .filters-form .col-md-6,
    .filter-form .col-md-2,
    .filter-form .col-md-3,
    .filter-form .col-md-4,
    .filter-form .col-md-6 {
        margin-bottom: 10px;
    }
    
    .filters-form .btn,
    .filter-form .btn {
        width: 100%;
    }
}

/* Modal Responsive */
.modal {
    padding: 0 !important;
}

.modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
}

.modal-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
    
    .modal-dialog.modal-lg {
        max-width: 700px;
    }
    
    .modal-dialog.modal-xl {
        max-width: 900px;
    }
}

@media (max-width: 575.98px) {
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header .btn-close {
        padding: 0.5rem;
        margin: -0.5rem -0.5rem -0.5rem auto;
    }
}

/* Cards Responsive */
.card {
    margin-bottom: 1rem;
}

.card-body {
    padding: 1.25rem;
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start !important;
    }
    
    .card-header .btn {
        align-self: flex-end;
    }
}

/* Stats Cards Responsive */
.stat-card {
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 1.5rem;
}

.stat-card .stat-label {
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem 0.75rem;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
}

/* Dashboard Welcome */
.dashboard-welcome {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.dashboard-welcome h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .dashboard-welcome {
        padding: 1.25rem;
    }
    
    .dashboard-welcome h2 {
        font-size: 1.25rem;
    }
    
    .dashboard-welcome p {
        font-size: 0.9rem;
    }
}

/* Forms Responsive */
.form-control, .form-select {
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
}

.form-label {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
}

@media (max-width: 576px) {
    .form-control, .form-select {
        font-size: 0.875rem;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
}

/* Pagination Responsive */
.pagination {
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Buttons Responsive */
.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* Settings Tabs Responsive */
.settings-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
}

.settings-tabs .nav-link {
    display: inline-block;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: normal;
}

@media (max-width: 768px) {
    .settings-tabs {
        padding-bottom: 0;
    }
    
    .settings-tabs .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .settings-tabs .nav-link i {
        display: block;
        margin-right: 0;
        margin-bottom: 0.25rem;
        font-size: 1rem;
    }
}

/* Ticket Details Responsive */
.ticket-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

.ticket-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .ticket-message-header {
        flex-direction: column;
    }
    
    .ticket-message-content {
        font-size: 0.9rem;
    }
}

/* Invoice Details Responsive */
.invoice-container {
    padding: 1.5rem;
}

.invoice-header {
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 576px) {
    .invoice-header {
        flex-direction: row;
        justify-content: space-between;
    }
}

.invoice-table {
    font-size: 0.9rem;
}

.invoice-table th,
.invoice-table td {
    padding: 0.75rem 0.5rem;
}

@media (max-width: 576px) {
    .invoice-container {
        padding: 1rem;
    }
    
    .invoice-table {
        font-size: 0.8rem;
    }
    
    .invoice-table th,
    .invoice-table td {
        padding: 0.5rem 0.375rem;
    }
}

/* Order Details Responsive */
.order-details .col-md-3,
.order-details .col-md-4,
.order-details .col-md-6 {
    margin-bottom: 1rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }
}

/* Focus States */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.btn-outline-primary:focus, .btn-outline-success:focus, .btn-outline-danger:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Card Body Scroll */
.card-body-scroll {
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive Grid Utilities */
.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        width: 100%;
    }
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn, 
    .nav-link, 
    .dropdown-item,
    .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-sm {
        min-height: 36px;
    }
    
    /* Touch-friendly dropdowns */
    .dropdown-toggle::after {
        display: inline-block;
        margin-left: 5px;
    }
    
    /* Swipeable elements */
    .swipe-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .swipe-item {
        scroll-snap-align: start;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-dialog {
        max-width: 90%;
        margin: 10px auto;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .card, .modal-content {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    .navbar, 
    .footer, 
    .btn, 
    .no-print {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th, 
    .table td {
        padding: 6px 8px;
    }
    
    body {
        background: white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, 
    *::before, 
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
