/* Ótica Lojão do Óculos - Estilos Principais */

:root {
    /* Cores Exatas do Sistema */
    --primary-red: #DC2626;
    --primary-red-hover: #B91C1C;
    --primary-red-light: #FEE2E2;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --green-500: #10B981;
    --green-600: #059669;
    --orange-500: #F59E0B;
    --orange-600: #D97706;
    --blue-500: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Login Page */
.login-container {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    /* Force full height */
    width: 100%;
    overflow: hidden;
    /* Prevent scrolling on desktop if possible */
}

.login-left {
    flex: 1;
    background-color: var(--primary-red);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    /* Reduced padding */
    position: relative;
    overflow-y: auto;
    /* Allow internal scroll if needed strictly */
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--white);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-red);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-logo svg {
    width: 32px;
    height: 32px;
}

.login-left h1 {
    font-size: 2.25rem;
    /* Slightly smaller title */
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.login-left p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    line-height: 1.5;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    /* Reduced gap */
    margin-top: 2rem;
    /* Reduced top margin */
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    /* Compact padding */
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card svg {
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-card p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.8;
}

.feature-badges {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    /* Reduced margin */
    flex-wrap: wrap;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.login-right {
    flex: 1;
    background-color: var(--white);
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-form-container p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--primary-red-light);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--gray-600);
}

.login-footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.sidebar-logo h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.sidebar-logo p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--gray-50);
    color: var(--primary-red);
}

.nav-item.active {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
    font-weight: 600;
    border-right: 3px solid var(--primary-red);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.user-details p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.btn-logout {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.main-content {
    flex: 1;
    margin-left: 260px;
    background-color: var(--gray-50);
}

.topbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--green-500);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--white);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.content {
    padding: 2rem;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

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

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-icon.blue {
    background-color: #DBEAFE;
    color: #3B82F6;
}

.kpi-icon.orange {
    background-color: #FEF3C7;
    color: #F59E0B;
}

.kpi-icon.green {
    background-color: #D1FAE5;
    color: #10B981;
}

.kpi-icon.red {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-red:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

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

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

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--gray-50);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-700);
}

tr:hover {
    background-color: var(--gray-50);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #D1FAE5;
    color: #059669;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #D97706;
}

.badge-danger {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
}

.badge-info {
    background-color: #DBEAFE;
    color: #3B82F6;
}

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

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
}

.search-bar svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}

/* Grid Layout */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.client-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.client-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Icon buttons - using 44px for better mobile touch targets */
.icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background-color: transparent;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
    background-color: var(--gray-50);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Responsive Charts Container */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 200px;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
}

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

/* Status badges for tables */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-warning {
    background-color: #FEF3C7;
    color: #D97706;
}

.status-success {
    background-color: #D1FAE5;
    color: #059669;
}

.status-danger {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
}

.status-info {
    background-color: #DBEAFE;
    color: #3B82F6;
}

.status-secondary {
    background-color: var(--gray-200);
    color: var(--gray-600);
}

/* Mobile Cards View - For converting tables to cards */
.mobile-data-cards {
    display: none;
}

.data-card-item {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.data-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.data-card-field {
    display: flex;
    flex-direction: column;
}

.data-card-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}

.data-card-value {
    font-size: 0.875rem;
    color: var(--gray-800);
    font-weight: 500;
}

.data-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

/* Small button variant */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-height: 32px;
}

/* Larger buttons on mobile for better touch */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
    }
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-danger {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
}

.alert-info {
    background-color: #DBEAFE;
    color: #3B82F6;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        padding: 2rem;
    }

    .login-left h1 {
        font-size: 1.75rem;
    }

    .login-features {
        grid-template-columns: 1fr;
    }

    .login-right {
        padding: 2rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 1rem;
        padding-left: 4rem;
    }

    .topbar h1 {
        font-size: 1.25rem;
    }

    .topbar-actions {
        gap: 0.5rem;
    }

    .content {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Charts responsive - stack vertically */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-bar {
        width: 100%;
    }

    .client-grid {
        grid-template-columns: 1fr;
    }

    .order-item {
        flex-direction: column;
        align-items: stretch;
    }

    .order-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .financial-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        white-space: nowrap;
    }

    /* Responsive tables - hide on mobile */
    .desktop-table {
        display: none;
    }

    /* Mobile cards - show on mobile */
    .mobile-data-cards {
        display: block;
    }

    /* Table container adjustments */
    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    th,
    td {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 1.5rem;
    }

    .login-left h1 {
        font-size: 1.5rem;
    }

    .login-right {
        padding: 1.5rem;
    }

    .login-form-container h2 {
        font-size: 1.5rem;
    }

    .feature-badges {
        flex-direction: column;
    }

    .kpi-card {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row>* {
        width: 100% !important;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.pagination-btn.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--gray-400);
}

.pagination-info {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-right: 0.5rem;
}

/* Form Dirty State */
.form-dirty {
    position: relative;
}

.form-dirty::before {
    content: '●';
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    color: var(--orange-500);
    font-size: 1.5rem;
}

/* Keyboard shortcut labels */
kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    box-shadow: inset 0 -1px 0 var(--gray-300);
}

/* Export button */
.btn-export {
    background: var(--green-600);
    color: var(--white);
    border: none;
}

.btn-export:hover {
    background: var(--green-500);
}

/* Toast styles - already defined in notifications.js */

@media (max-width: 768px) {
    .pagination {
        gap: 0.125rem;
    }

    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 768px) {

    /* Login Page */
    .login-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .login-left {
        padding: 2rem 1.5rem;
        flex: 0 0 auto;
        text-align: center;
        order: 2;
        /* Show features after login form */
        background-color: var(--white);
        color: var(--gray-800);
    }

    .login-right {
        padding: 2rem 1.5rem;
        flex: 0 0 auto;
        order: 1;
        /* Form first */
        background-color: var(--white);
        border-bottom: 1px solid var(--gray-100);
    }

    .login-logo {
        display: none;
    }

    .login-left h1,
    .login-left p {
        display: none;
    }

    /* Mobile Feature Cards (Miniature) */
    .login-features {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .feature-card {
        padding: 1rem;
        background-color: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        text-align: center;
        backdrop-filter: none;
    }

    .feature-card h3 {
        font-size: 0.8rem;
        color: var(--gray-900);
        margin-bottom: 0;
    }

    .feature-card p {
        display: none;
    }

    .feature-card svg {
        color: var(--primary-red);
        margin-bottom: 0.5rem;
        width: 24px;
        height: 24px;
    }

    .feature-badges {
        display: none;
    }

    /* Dashboard & Layout */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 80px;
        /* Space for footer */
    }

    .topbar {
        padding: 1rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Cards & Grids */
    .kpi-grid,
    .charts-grid,
    .client-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }

    /* Tables */
    .table-container {
        border: 1px solid var(--gray-200);
        border-radius: 8px;
    }

    /* Mobile adjustments for financial cards */
    .installment-card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }

    .installment-actions {
        flex-direction: column;
    }

    .btn-whatsapp,
    .btn-mark-paid {
        width: 100%;
    }
}

/* END MAC-WIDTH: 768px */

/* =========================================
   GLOBAL FINANCIAL STYLES (Apply everywhere)
   ========================================= */
.installment-card {
    background-color: #FFE4E6;
    /* Stronger Pink/Rose for overdue */
    border: 1px solid #FECDD3;
    /* Darker pink border */
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.installment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
    padding-bottom: 1rem;
}

.installment-card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #991B1B;
    margin: 0;
}

.installment-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.installment-detail-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7F1D1D;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.installment-detail-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.installment-detail-value.highlight-red {
    color: #DC2626;
    font-size: 1.25rem;
    font-weight: 800;
}

.installment-actions {
    display: flex;
    gap: 1rem;
}

/* Specific Buttons */
.btn-whatsapp {
    background-color: #25D366 !important;
    /* Force Green */
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
    text-decoration: none;
}

.btn-whatsapp:hover {
    background-color: #128C7E !important;
    transform: translateY(-1px);
}

.btn-mark-paid {
    background-color: #2563EB !important;
    /* Force Blue */
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    text-decoration: none;
}

.btn-mark-paid:hover {
    background-color: #1D4ED8 !important;
    transform: translateY(-1px);
}


/* =========================================
   GLOBAL FOOTER
   ========================================= */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #111827;
    color: #9CA3AF;
    font-size: 0.875rem;
    margin-top: auto;
    border-top: 1px solid #1F2937;
}

.app-footer strong {
    color: #F3F4F6;
    font-weight: 600;
}

.app-footer .footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.app-footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.app-footer a:hover {
    color: var(--primary-red-light);
    transform: translateX(2px);
}

/* Login Page Footer Specifics */
.login-page-footer {
    /* On mobile login, static at bottom of content. On desktop, fixed or static depending on height */
}

/* =========================================
   DESKTOP SPECIFICS
   ========================================= */
@media (min-width: 769px) {
    .login-page-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 50;
        background-color: #111827;
        border-top: 1px solid #1F2937;
        padding: 0.75rem 0;
        pointer-events: auto;
        text-align: left;
        color: #9CA3AF;
        text-shadow: none;
    }

    .login-page-footer .footer-content {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 2rem;
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .login-page-footer strong {
        color: #fff;
    }

    .login-page-footer a {
        color: var(--primary-red);
        /* Keep brand color for link */
        text-decoration: none;
    }

    .login-page-footer a:hover {
        color: var(--primary-red-light);
        text-decoration: none;
    }
}
/* =========================================
   TABLET LANDSCAPE OPTIMIZATION
   ========================================= */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .content {
        padding: 1.5rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   RESPONSIVE GRADE CONTROLS (+/- BUTTONS)
   ========================================= */
/* Ensure grade input controls are touch-friendly on all devices */
@media (max-width: 768px) {
    /* Increase button size for mobile */
    table button[onclick*="adjustValue"] {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.875rem !important;
        min-width: 32px;
        min-height: 32px;
    }
    
    /* Make input fields more touch-friendly */
    table input[type="number"] {
        min-height: 36px;
        font-size: 1rem !important;
    }
}

/* Tablet optimization for grade tables */
@media (min-width: 769px) and (max-width: 1024px) {
    table button[onclick*="adjustValue"] {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
}

/* Ensure tables scroll horizontally on small screens */
@media (max-width: 768px) {
    .table-container,
    div[style*="overflow-x: auto"] {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}
