/* ============================================================================
   CIRCUIT ART - KWD EDITION - COMPLETE MODERN CSS
   Beautiful, Fast, Responsive
   ============================================================================ */

:root {
    --primary: #6C5CE7;
    --secondary: #74B9FF;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #FF7675;
    --dark: #2D3436;
    --light: #F8F9FA;
    --gray: #636E72;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
    --shadow-md: 0 4px 16px rgba(108, 92, 231, 0.12);
    --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.background-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(1.1); }
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.circuit-logo {
    display: inline-block;
    margin-bottom: 20px;
    animation: rotate 20s linear infinite;
}

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

.logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-section p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 8px;
}

.currency-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #00B894 0%, #55EFC4 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.currency-badge-small {
    display: inline-block;
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}

.login-form {
    margin-top: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    z-index: 1;
}

.input-wrapper input,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E9ECEF;
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.input-wrapper input {
    padding-left: 48px;
}

.input-wrapper input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.error-message {
    display: none;
    background: #FFE5E5;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
}

.btn-login.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-arrow {
    transition: var(--transition);
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
}

.demo-credentials {
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
}

.demo-credentials small {
    color: var(--gray);
    font-size: 13px;
}

.demo-credentials strong {
    color: var(--primary);
}

/* ============================================================================
   DASHBOARD LAYOUT
   ============================================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--light);
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #E9ECEF;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-mini svg {
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    flex-shrink: 0;
    stroke-width: 2;
}

.nav-divider {
    height: 1px;
    background: #E9ECEF;
    margin: 16px 20px;
}

.nav-header {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 16px 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar svg {
    position: absolute;
    left: 16px;
    color: var(--gray);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #E9ECEF;
    border-radius: 12px;
    font-size: 14px;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.user-role {
    font-size: 12px;
    color: var(--gray);
}

.btn-logout {
    padding: 8px 12px;
    background: transparent;
    border: 2px solid #E9ECEF;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
}

.btn-logout:hover {
    background: #FFE5E5;
    border-color: var(--danger);
    color: var(--danger);
}

.content-wrapper {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.content-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.section-header p {
    color: var(--gray);
    font-size: 15px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 24px;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 16px;
}

.stat-icon.primary { background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%); }
.stat-icon.success { background: linear-gradient(135deg, #00B894 0%, #55EFC4 100%); }
.stat-icon.warning { background: linear-gradient(135deg, #FDCB6E 0%, #FFEAA7 100%); }
.stat-icon.danger { background: linear-gradient(135deg, #FF7675 0%, #FAB1A0 100%); }

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

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

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

.data-table thead {
    background: var(--light);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E9ECEF;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #E9ECEF;
    color: var(--dark);
}

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

.data-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.04);
}

.data-table .loading {
    text-align: center;
    color: var(--gray);
    padding: 40px;
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.3);
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-success {
    padding: 8px 16px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-success:hover {
    background: #00a085;
    transform: translateY(-1px);
}

.btn-danger {
    padding: 12px 24px;
    background: linear-gradient(135deg, #FF7675 0%, #FAB1A0 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 118, 117, 0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57C00;
}

.alert-info {
    background: #E3F2FD;
    color: #1976D2;
}

.alert-success {
    background: #E8F5E9;
    color: #388E3C;
}

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

/* Search Box */
.search-box-large {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box-large input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #E9ECEF;
    border-radius: 12px;
    font-size: 15px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E9ECEF;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--dark);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--light);
    color: var(--dark);
}

/* Student List in Project Form */
.students-list {
    margin-top: 20px;
}

.student-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr auto;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
    align-items: center;
}

.student-row.added {
    background: #E8F5E9;
}

.student-info {
    display: flex;
    flex-direction: column;
}

.student-info strong {
    color: var(--dark);
    font-size: 14px;
}

.student-info small {
    color: var(--gray);
    font-size: 12px;
}

/* KWD Amount Display */
.kwd-amount {
    font-weight: 600;
    color: var(--success);
}

.amount-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.amount-display::after {
    content: ' KWD';
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
    margin-left: 4px;
}

.balance-positive {
    color: var(--success);
}

.balance-negative {
    color: var(--danger);
}

/* Project Details */
.project-details {
    margin-top: 20px;
}

.project-summary {
    background: var(--light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.project-summary h3 {
    margin-bottom: 16px;
    color: var(--dark);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #E9ECEF;
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
    padding-top: 12px;
}

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

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

/* Notification Toast */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    font-weight: 600;
    max-width: 400px;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

.notification.success { background: #00B894; color: white; }
.notification.error { background: #FF7675; color: white; }
.notification.warning { background: #FDCB6E; color: white; }
.notification.info { background: #74B9FF; color: white; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .top-bar {
        padding: 12px 16px;
    }
    
    .content-wrapper {
        padding: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray); }
.font-bold { font-weight: 700; }

/* ============================================================================
   DARK THEME
   ============================================================================ */

.dark-theme {
    --primary: #A29BFE;
    --secondary: #74B9FF;
    --success: #55EFC4;
    --warning: #FFEAA7;
    --danger: #FAB1A0;
    --dark: #F8F9FA;
    --light: #2D3436;
    --gray: #B2BEC3;
    --white: #1E272E;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dark-theme body {
    background: #1E272E;
    color: #F8F9FA;
}

.dark-theme .sidebar {
    background: #2D3436;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.dark-theme .top-bar {
    background: #2D3436;
    border-bottom: 1px solid #404040;
}

.dark-theme .card {
    background: #2D3436;
    color: #F8F9FA;
}

.dark-theme .stat-card {
    background: #2D3436;
}

.dark-theme .data-table thead {
    background: #1E272E;
}

.dark-theme .data-table tbody tr:hover {
    background: rgba(162, 155, 254, 0.1);
}

.dark-theme .data-table td {
    border-bottom-color: #404040;
}

.dark-theme .nav-item:hover,
.dark-theme .nav-item.active {
    background: rgba(162, 155, 254, 0.15);
}

.dark-theme .modal {
    background: #2D3436;
    color: #F8F9FA;
}

.dark-theme .form-group input,
.dark-theme .form-group select,
.dark-theme .form-group textarea {
    background: #1E272E;
    color: #F8F9FA;
    border-color: #404040;
}

.dark-theme .form-group input:focus,
.dark-theme .form-group select:focus,
.dark-theme .form-group textarea:focus {
    background: #1E272E;
    border-color: var(--primary);
}

.dark-theme .alert {
    background: #2D3436;
    border: 1px solid #404040;
}

.dark-theme .student-item {
    background: #1E272E;
}

/* Theme Button Styles */
.theme-btn {
    padding: 12px 24px;
    background: white;
    color: var(--dark);
    border: 2px solid #E9ECEF;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.theme-btn.active {
    background: linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%);
    color: white;
    border-color: var(--primary);
}

.dark-theme .theme-btn {
    background: #2D3436;
    color: #F8F9FA;
    border-color: #404040;
}

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

.dark-theme .theme-btn.active {
    background: linear-gradient(135deg, #A29BFE 0%, #74B9FF 100%);
    color: white;
}

/* WhatsApp Reminder Button Styling */
.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

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

/* Update btn-warning for consistent styling */
.btn-warning {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ============================================================
   MOBILE NAVIGATION — Complete Fix
   ============================================================ */

/* Hamburger button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 26px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    margin-right: 12px;
}
.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #1E3A8A;
    border-radius: 3px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger { display: flex; }

    /* Sidebar slides in from left */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100dvh;
        width: 280px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100;
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }

    /* Main content full width */
    .main-content { margin-left: 0 !important; }

    /* Top bar layout on mobile */
    .top-bar {
        position: sticky;
        top: 0;
        z-index: 200;
        background: #fff;
        display: flex;
        align-items: center;
        padding: 10px 12px !important;
        gap: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        flex-wrap: nowrap !important;
    }

    /* Search takes remaining space */
    .search-bar {
        order: 0;
        flex: 1;
        margin: 0 !important;
        min-width: 0;
    }

    /* User menu compact */
    .user-info { display: none; }
    .user-menu { gap: 8px; }

    /* Content padding */
    .content-wrapper { padding: 12px !important; }

    /* Stats 2 columns on tablet */
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }

    /* Tables scroll horizontally */
    .data-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 600px; }

    /* Modals full screen */
    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        margin: 10px auto !important;
        max-height: 90dvh;
        overflow-y: auto;
    }

    /* Buttons smaller */
    .btn-small, .btn-sm { padding: 5px 8px; font-size: 11px; }
    
    /* Form grids single column */
    .form-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .section-header h1 { font-size: 18px; }
}

/* ============================================================
   NO HORIZONTAL SCROLL — Tables become cards on phone
   ============================================================ */
@media (max-width: 768px) {

    /* Kill ALL horizontal overflow at root */
    html, body, .app-container, .main-content, .content-wrapper {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Hide table headers on mobile */
    .data-table-container { overflow-x: hidden !important; }
    .data-table { min-width: unset !important; width: 100% !important; }
    .data-table thead { display: none !important; }

    /* Each row becomes a card */
    .data-table tbody tr {
        display: block !important;
        background: #fff !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
        padding: 10px 12px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
    }
    .data-table tbody tr:hover { background: #F8FAFF !important; }

    /* Each cell becomes a row with label */
    .data-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 0 !important;
        border: none !important;
        font-size: 13px !important;
        border-bottom: 1px solid #F3F4F6 !important;
        gap: 8px;
        flex-wrap: wrap;
    }
    .data-table td:last-child { border-bottom: none !important; }

    /* Show column label from data-label attribute */
    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6B7280;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Buttons wrap nicely */
    .data-table td:last-child {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: flex-end;
    }

    /* Stats 2 per row on mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .stat-card { padding: 12px !important; }
    .stat-value { font-size: 18px !important; }
    .stat-label { font-size: 11px !important; }

    /* Modal full screen */
    .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 90dvh !important;
        overflow-y: auto !important;
    }

    /* Section header stacks */
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .section-header .header-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
    .section-header .header-actions button { flex: 1; min-width: 120px; }

    /* Form grid 1 col */
    .form-grid { grid-template-columns: 1fr !important; }
    .form-group[style*="grid-column"] { grid-column: 1 !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
}
