/* ===== PROFESSIONAL WATER MANAGEMENT CSS ===== */

/* Global Styles & CSS Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-blue: #1e5aa8;
    --secondary-blue: #2874d6;
    --light-blue: #4a9eff;
    --dark-blue: #0d3d6b;
    --accent-cyan: #00b4d8;
    --accent-teal: #38b2ac;
    --background-dark: #1a2332;
    --background-light: #f0f4f8;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --text-muted: #6c757d;

    /* Status Colors */
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --info: #17a2b8;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.25);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
video {
    max-width: 100%;
    height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 5px;
}

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

/* ===== LANDING PAGE STYLES ===== */
.landing-page {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 50%, var(--secondary-blue) 100%);
    color: var(--text-light);
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.landing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-container {
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}

.landing-logo {
    width: 250px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.landing-title {
    font-size: 3rem;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.landing-subtitle {
    font-size: 1.3rem;
    margin-bottom: 50px;
    text-align: center;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 50px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 35px;
    text-align: center;
    transition: all var(--transition-base);
    animation: fadeInUp 1s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:nth-child(1) {
    animation-delay: 0.6s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.7s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.8s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.9s;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--accent-cyan);
}

.feature-card p {
    opacity: 0.9;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 1s ease-out 1s backwards;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 44px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--light-blue) 100%);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: 0 12px 30px rgba(0, 180, 216, 0.5);
    transform: translateY(-3px);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.landing-footer {
    text-align: center;
    padding: 30px 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ===== LOGIN PAGE STYLES ===== */
.login-page {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.8s ease-out;
}

.login-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: 45px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    color: var(--dark-blue);
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.login-form {
    margin-bottom: 20px;
}

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

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: #fafafa;
    min-height: 44px;
}

.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: #fafafa;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    min-height: 44px;
}

.form-group input:hover {
    border-color: #d0d0d0;
    background: white;
}

.form-group textarea:hover {
    border-color: #d0d0d0;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 90, 168, 0.1);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 90, 168, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
}

.checkbox-label input {
    margin-right: 8px;
}

.forgot-password {
    color: var(--primary-blue);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.demo-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid var(--accent-cyan);
}

.demo-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

.demo-info code {
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--dark-blue);
    font-weight: 600;
}

.login-footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.login-footer p {
    margin: 10px 0;
}

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

.login-footer a:hover {
    text-decoration: underline;
}

.login-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.login-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== DASHBOARD STYLES ===== */
body:not(.landing-page):not(.login-page) {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(20px);
    padding: 22px 35px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-overlay {
    display: none;
}

/* Dashboard Layout with Sidebar */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, rgba(13, 61, 107, 0.98) 0%, rgba(13, 61, 107, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all var(--transition-base);
    border-left: 4px solid transparent;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-teal));
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

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

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    padding-left: 30px;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 180, 216, 0.2) 0%, transparent 100%);
    color: white;
    border-left-color: var(--accent-cyan);
    font-weight: 600;
    padding-left: 30px;
}

.nav-icon {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 100%;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.dashboard-logo {
    width: 80px;
    height: auto;
    display: block;
}

.header-title h1 {
    color: var(--text-light);
    font-size: 2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-title p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.user-info {
    color: var(--text-light);
    text-align: right;
}

.user-info .username {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-info .role {
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn-logout {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95) 0%, rgba(200, 35, 51, 1) 100%);
    color: white;
    padding: 11px 22px;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: clamp(16px, 3vw, 30px);
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

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

.card h2 {
    color: var(--dark-blue);
    margin-bottom: 22px;
    font-size: 1.7rem;
    position: relative;
    padding-bottom: 12px;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
    border-radius: 2px;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    font-size: 0.9rem;
    padding: 11px 22px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-size: 0.85rem;
    padding: 7px 14px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4757 100%);
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
    transform: translateY(-2px);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 22px;
}

.summary-item {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 28px;
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.summary-item:hover::before {
    opacity: 1;
}

.summary-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.summary-item.inventory {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.3);
}

.summary-item.profit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3);
}

.summary-item.debt {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.summary-label {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.summary-value {
    font-size: 2.4rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 8px 0;
}

.summary-sublabel {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 8px;
    font-weight: 300;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    position: relative;
}

thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
}

th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

th:first-child {
    border-top-left-radius: var(--radius-md);
}

th:last-child {
    border-top-right-radius: var(--radius-md);
}

td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-dark);
    transition: background-color var(--transition-fast);
}

tbody tr {
    transition: all var(--transition-fast);
    background: white;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(30, 90, 168, 0.04) 0%, rgba(0, 180, 216, 0.04) 100%);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 50px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

/* Debt row styling */
.debt-paid {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.04) 100%) !important;
    border-left: 4px solid var(--success) !important;
}

.debt-unpaid {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 193, 7, 0.04) 100%) !important;
    border-left: 4px solid var(--warning) !important;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.badge:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
}

/* Small button styling */
.btn-sm {
    padding: 7px 14px;
    font-size: 0.85rem;
    margin-right: 6px;
    border-radius: var(--radius-sm);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== UTILITY CLASSES ===== */

/* Spacing Utilities */
.mt-1 {
    margin-top: 0.5rem;
}

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

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

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

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

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

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

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

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-bold {
    font-weight: 700;
}

.text-semibold {
    font-weight: 600;
}

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

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--primary-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-left: 4px solid;
    animation: slideInLeft 0.3s ease-out;
}

.alert-success {
    background: var(--success-light);
    border-left-color: var(--success);
    color: #155724;
}

.alert-danger {
    background: var(--danger-light);
    border-left-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left-color: var(--info);
    color: #0c5460;
}

/* Card Variants */
.card-gradient {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
    backdrop-filter: blur(10px);
}

.card-bordered {
    border: 2px solid var(--primary-blue);
}

.card-shadow-lg {
    box-shadow: var(--shadow-xl);
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}

/* Display Utilities */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Position Utilities */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* Overflow Utilities */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-scroll {
    overflow: scroll;
}

/* Border Radius Utilities */
.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 9999px;
}

/* Shadow Utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

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

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.shadow-none {
    box-shadow: none;
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 3px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Smooth Transitions */
.transition-all {
    transition: all var(--transition-base);
}

.transition-colors {
    transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
}

.loading-spinner .spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-spinner p {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

/* Notification Toast */
.notification-toast {
    animation: slideInRight 0.3s ease-out;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.alert-success {
    background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
    color: white;
    border: none;
}

.alert-error {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
}

/* Print Styles */
@media print {

    .btn,
    .nav-item,
    .sidebar,
    .dashboard-header {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    table {
        page-break-inside: avoid;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== CHARTS & ANALYTICS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.chart-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
    min-height: 350px;
}

.chart-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.chart-container h3 {
    color: var(--dark-blue);
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--background-light);
    position: relative;
}

.chart-container h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
}

.chart-full-width {
    grid-column: 1 / -1;
}

.chart-filter {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-left: 10px;
}

.chart-filter:hover {
    border-color: var(--primary-blue);
}

.chart-filter:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 90, 168, 0.1);
}

canvas {
    max-height: 280px;
    width: 100% !important;
}

.chart-full-width canvas {
    max-height: 350px;
}

/* Chart Loading State */
.chart-container.loading {
    position: relative;
    min-height: 350px;
}

.chart-container.loading::before {
    content: 'Loading chart data...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* No Data State */
.no-data-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-data-message::before {
    content: '📊';
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 16px 20px;
    }

    .header-title h1 {
        font-size: 1.6rem;
    }

    .sidebar {
        width: 220px;
    }

    .main-content {
        padding: 20px;
    }

    .summary-value {
        font-size: 2rem;
    }

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

@media (max-width: 768px) {
    .landing-title {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: 1.1rem;
    }

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

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-large {
        width: 100%;
    }

    .login-box {
        padding: 30px 20px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        padding: 14px 12px;
        text-align: center;
        position: relative;
    }

    .header-left {
        flex-direction: column;
        gap: 8px;
    }

    .header-title h1 {
        font-size: 1.35rem;
    }

    .header-title p {
        font-size: 0.9rem;
    }

    .dashboard-logo {
        width: 62px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .user-info {
        text-align: center;
        width: 100%;
    }

    /* Mobile Sidebar */
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 78vw;
        max-width: 310px;
        min-width: 250px;
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-104%);
        transition: transform 0.28s ease;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        padding: 14px 0;
        z-index: 1200;
    }

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

    .sidebar-nav {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        gap: 2px;
        padding: 6px 0;
    }

    .nav-item {
        flex-direction: row;
        gap: 10px;
        padding: 12px 16px;
        min-width: auto;
        text-align: left;
        border-left: 3px solid transparent;
        border-bottom: none;
        white-space: normal;
        border-radius: 0;
    }

    .nav-item.active {
        border-left: 3px solid var(--accent-cyan);
        border-bottom-color: transparent;
    }

    .nav-item:hover {
        border-left: 3px solid var(--accent-cyan);
        border-bottom-color: transparent;
    }

    .nav-icon {
        font-size: 1.15rem;
    }

    .nav-text {
        font-size: 0.9rem;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(9, 19, 32, 0.46);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        display: block;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .main-content {
        padding: 12px;
    }

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

    .summary-header {
        flex-direction: column;
        gap: 15px;
    }

    table {
        font-size: 0.85rem;
        min-width: 680px;
    }

    th,
    td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .form-group input,
    .form-group textarea,
    .form-group select,
    .btn {
        font-size: 16px;
    }

    /* Charts Responsive */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .chart-container {
        min-height: 300px;
        padding: 20px 15px;
    }

    .chart-container h3 {
        font-size: 1rem;
    }

    .chart-full-width {
        grid-column: 1;
    }

    canvas {
        max-height: 250px !important;
    }

    .chart-filter {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    .flex-between {
        flex-direction: column;
        align-items: stretch !important;
    }
}

@media (max-width: 480px) {
    .landing-container {
        padding: 20px 14px;
    }

    .landing-title {
        font-size: 1.65rem;
    }

    .login-box {
        padding: 22px 14px;
        border-radius: 14px;
    }

    .summary-value {
        font-size: 1.75rem;
    }

    .card h2 {
        font-size: 1.25rem;
    }

    .btn-sm {
        padding: 8px 10px;
        margin-right: 4px;
    }

    .nav-text {
        font-size: 0.7rem;
    }
}