


/* ========================================
   CSS Variables & Root Styles
   ======================================== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --dark: #2d3748;
    --light: #f7fafc;
    --gray: #718096;
    
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-dark: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    
    --header-height: 60px;
    --footer-height: 65px;
    --fab-size: 56px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ========================================
   Global Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}
/* ========================================
   Sticky Header
   ======================================== */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-lg);
}
@supports (padding: max(0px)) {
    .sticky-header {
        padding-top: max(0px, env(safe-area-inset-top));
    }
}
.sticky-header .navbar {
    min-height: var(--header-height);
    padding: 0.5rem 1rem;
}
.sticky-header .navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff !important;
}
.sticky-header .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sticky-header .nav-link:hover,
.sticky-header .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
}
.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}
/* ========================================
   Main Content Area
   ======================================== */
.main-content {
    padding-top: calc(var(--header-height) + 10px);
    padding-bottom: calc(var(--footer-height) + 20px);
    min-height: 100vh;
}
@supports (padding: max(0px)) {
    .main-content {
        padding-top: calc(var(--header-height) + max(10px, env(safe-area-inset-top)));
        padding-bottom: calc(var(--footer-height) + max(20px, env(safe-area-inset-bottom)));
    }
}
/* ========================================
   Mobile App Footer
   ======================================== */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1020;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
@supports (padding: max(0px)) {
    .mobile-footer {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}
.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--footer-height);
    padding: 0 0.5rem;
}
.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 60px;
}
.footer-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}
.footer-nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-nav-item:hover,
.footer-nav-item.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}
.footer-nav-item.active {
    transform: translateY(-2px);
}
/* Hide footer on larger screens */
@media (min-width: 992px) {
    .mobile-footer {
        display: none;
    }
    
    .main-content {
        padding-bottom: 2rem;
    }
}
/* ========================================
   Floating Action Button
   ======================================== */
.fab-container {
    position: fixed;
    bottom: calc(var(--footer-height) + 20px);
    right: 20px;
    z-index: 1025;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}
@supports (padding: max(0px)) {
    .fab-container {
        bottom: calc(var(--footer-height) + max(20px, env(safe-area-inset-bottom)));
        right: max(20px, env(safe-area-inset-right));
    }
}
@media (min-width: 992px) {
    .fab-container {
        bottom: 30px;
    }
}
.fab-main {
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.fab-main:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}
.fab-main:active {
    transform: scale(0.95);
}
.fab-main .fab-icon-close {
    display: none;
}
.fab-main.active .fab-icon-open {
    display: none;
}
.fab-main.active .fab-icon-close {
    display: block;
}
.fab-main.active {
    transform: rotate(180deg);
}
.fab-options {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    margin-bottom: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}
.fab-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.fab-option {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: var(--transition);
}
.fab-option:hover {
    transform: scale(1.15);
    background: var(--primary);
    color: #fff;
}
.fab-option.whatsapp:hover {
    background: #25d366;
}
/* ========================================
   Cards & Containers
   ======================================== */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
    overflow: hidden;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
}
.card-title {
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}
.card-body {
    padding: 1.25rem;
}
/* ========================================
   Stat Cards
   ======================================== */
.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card.bg-primary { background: var(--gradient-primary); }
.stat-card.bg-success { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.stat-card.bg-info { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); }
.stat-card.bg-warning { background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%); }
.stat-card.bg-danger { background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}
.stat-content {
    flex: 1;
    min-width: 0;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
@media (max-width: 575.98px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}
/* ========================================
   Activity List
   ======================================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.activity-content {
    flex: 1;
    min-width: 0;
}
.activity-text {
    margin: 0;
    font-size: 0.9375rem;
}
.activity-time {
    font-size: 0.75rem;
}
/* ========================================
   Login Page
   ======================================== */
.login-page {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-container {
    width: 100%;
    max-width: 420px;
}
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-xl);
}
.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow);
}
.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--dark);
}
.login-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
}
.login-form .form-floating {
    position: relative;
}
.login-form .form-control {
    border-radius: var(--radius);
    border: 2px solid #e2e8f0;
    padding: 1rem 1rem 1rem 2.75rem;
    height: auto;
    font-size: 1rem;
}
.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.login-form .form-floating > label {
    padding: 1rem 1rem 1rem 2.75rem;
}
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10;
}
.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    transition: var(--transition);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    opacity: 0.95;
}
.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
}
/* ========================================
   Page Headers
   ======================================== */
.page-header {
    margin-bottom: 1.5rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
}
@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.25rem;
    }
}
/* ========================================
   Tables
   ======================================== */
.table {
    margin: 0;
}
.table th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom-width: 1px;
}
.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}
.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}
/* ========================================
   Buttons
   ======================================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}
.btn:hover {
    transform: translateY(-1px);
}
.btn-primary {
    background: var(--gradient-primary);
    border: none;
}
.btn-primary:hover {
    opacity: 0.9;
    background: var(--gradient-primary);
}
/* ========================================
   Badges
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-sm);
}
/* ========================================
   Modals
   ======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}
.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
}
/* ========================================
   Alerts
   ======================================== */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
/* ========================================
   Forms
   ======================================== */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 2px solid #e2e8f0;
    padding: 0.625rem 1rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
/* ========================================
   Internet Status
   ======================================== */
#internetStatus {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
}
#internetStatus.offline {
    background-color: var(--danger) !important;
}
/* ========================================
   Image Gallery
   ======================================== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.image-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #fff;
}
.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 2rem 0.75rem 0.75rem;
    opacity: 0;
    transition: var(--transition);
}
.image-card:hover .image-overlay {
    opacity: 1;
}
.image-size {
    font-size: 0.75rem;
    opacity: 0.9;
}
/* ========================================
   Upload Dropzone
   ======================================== */
.upload-dropzone {
    border: 2px dashed #cbd5e0;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: #f7fafc;
    transition: var(--transition);
    cursor: pointer;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}
.upload-dropzone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.375rem 0.5rem;
    }
}
/* ========================================
   Dropdown Menu Dark Theme
   ======================================== */
.dropdown-menu-dark {
    background: var(--gradient-dark);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.dropdown-menu-dark .dropdown-item {
    color: rgba(255,255,255,0.8);
    padding: 0.625rem 1rem;
    transition: var(--transition);
}
.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.dropdown-menu-dark .dropdown-divider {
    border-color: rgba(255,255,255,0.1);
}
.dropdown-menu-dark .dropdown-header {
    color: rgba(255,255,255,0.5);
    padding: 0.5rem 1rem;
}
/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
/* ========================================
   Print Styles
   ======================================== */
@media print {
    .sticky-header,
    .mobile-footer,
    .fab-container {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
}