:root {
    --bg-primary: #0090d0;
    --bg-secondary: #154e9e;
    --bg-card: rgba(255, 255, 255, 0.4);
    --bg-glass: rgba(255, 255, 255, 0.15);
    --border-glass: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #e0f2fe;
    --text-muted: #bae6fd;
    /* Tanzanite Brand Colors */
    --accent-red: #f56c6c; /* Element Plus Danger */
    --accent-orange: #e6a23c; /* Element Plus Warning */
    --accent-blue: #1353aa; /* Tanzanite Primary */
    --accent-purple: #7066e0; /* Swal2 Confirm */
    --accent-green: #0d7741; /* Tanzanite Quaternary */
    --accent-yellow: #f6f14c; /* Tanzanite Secondary */
    --accent-cyan: #00a3dd; /* Tanzanite Tertiary */

    /* Gradients */
    --grad-red: linear-gradient(135deg, #f89898, #f56c6c);
    --grad-orange: linear-gradient(135deg, #f3d19e, #e6a23c);
    --grad-blue: linear-gradient(135deg, #79bbff, #1353aa);
    --grad-purple: linear-gradient(135deg, #a39cf0, #7066e0);
    --grad-green: linear-gradient(135deg, #b3e19d, #0d7741);
    
    /* Glowing Shadows */
    --glow-red: 0 8px 16px rgba(245, 108, 108, 0.3);
    --glow-orange: 0 8px 16px rgba(230, 162, 60, 0.3);
    --glow-blue: 0 8px 16px rgba(19, 83, 170, 0.3);
    --glow-purple: 0 8px 16px rgba(112, 102, 224, 0.3);
    --glow-green: 0 8px 16px rgba(13, 119, 65, 0.3);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    background-attachment: fixed;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Smooth scrollbar styling for webkit */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-glass);
}

/* Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    padding: 0 32px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
    position: sticky;
    top: 0;
}

.topbar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-logo i {
    -webkit-text-fill-color: var(--text-primary);
}

.topbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover {
    background-color: var(--bg-glass);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: var(--bg-glass);
    color: var(--text-primary);
    border-bottom: 3px solid var(--accent-yellow);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nav-link i {
    font-size: 1.25rem;
}

.nav-item-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 8px 0;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #1e293b;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item i {
    font-size: 1.1rem;
    color: #64748b;
}

.dropdown-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 8px 0;
}

.text-danger {
    color: var(--accent-red) !important;
}
.text-danger i {
    color: var(--accent-red) !important;
}

.topbar-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: var(--transition);
}
.user-avatar:hover {
    background-color: rgba(255, 255, 255, 0.25);
}
.user-avatar i {
    font-size: 1.25rem;
}

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

.header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.search-box {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 200px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-glass);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    color: var(--text-primary);
}

.notification-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background-color: #dc2626;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    animation: pulse 2s infinite;
}

/* Module Cards Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.module-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #1e293b;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--border-glass);
}

.module-card.clearing .module-icon {
    color: white;
    background: var(--grad-red);
    box-shadow: var(--glow-red);
}
.module-card.clearing::before { background: var(--grad-red); }

.module-card.container .module-icon {
    color: white;
    background: var(--grad-orange);
    box-shadow: var(--glow-orange);
}
.module-card.container::before { background: var(--grad-orange); }

.module-card.port .module-icon {
    color: white;
    background: var(--grad-blue);
    box-shadow: var(--glow-blue);
}
.module-card.port::before { background: var(--grad-blue); }

.module-card.declaration .module-icon {
    color: white;
    background: var(--grad-purple);
    box-shadow: var(--glow-purple);
}
.module-card.declaration::before { background: var(--grad-purple); }

.module-card.vehicle .module-icon {
    color: white;
    background: var(--grad-green);
    box-shadow: var(--glow-green);
}
.module-card.vehicle::before { background: var(--grad-green); }

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.module-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.module-card .count {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.module-card .label {
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    color: #1e293b;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.red { background: var(--grad-red); color: white; box-shadow: var(--glow-red); }
.stat-icon.orange { background: var(--grad-orange); color: white; box-shadow: var(--glow-orange); }
.stat-icon.blue { background: var(--grad-blue); color: white; box-shadow: var(--glow-blue); }
.stat-icon.green { background: var(--grad-green); color: white; box-shadow: var(--glow-green); }
.stat-icon.purple { background: var(--grad-purple); color: white; box-shadow: var(--glow-purple); }

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info .stat-label {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 2px;
}

/* Section Headers */
.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent-yellow);
    text-transform: uppercase;
}

.section-header .view-all {
    color: var(--accent-blue);
    font-size: 0.875rem;
    text-decoration: none;
}
.section-header .view-all:hover {
    text-decoration: underline;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #1e293b;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Data Table */
.table-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-card .table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.table-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

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

thead {
    background-color: #f8fafc;
}

th {
    padding: 12px 24px;
    text-align: left;
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 16px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background-color: #f1f5f9;
}

tr:last-child td {
    border-bottom: none;
}

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

.badge.active, .badge.in-progress {
    background-color: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.badge.pending, .badge.inspection {
    background-color: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.badge.cleared {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.badge.delayed, .badge.alert {
    background-color: rgba(255, 75, 43, 0.15);
    color: #b91c1c;
}

.badge.completed {
    background-color: rgba(139, 92, 246, 0.15);
    color: #6d28d9;
}

/* Alerts Section */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.alert-card {
    background-color: #ffffff;
    color: #1e293b;
    border-left: 3px solid;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
}

.alert-card.warning { border-color: var(--accent-yellow); }
.alert-card.warning .alert-icon { color: var(--accent-yellow); }

.alert-card.danger { border-color: var(--accent-red); }
.alert-card.danger .alert-icon { color: var(--accent-red); }

.alert-card.info { border-color: var(--accent-blue); }
.alert-card.info .alert-icon { color: var(--accent-blue); }

.alert-card.success { border-color: var(--accent-green); }
.alert-card.success .alert-icon { color: var(--accent-green); }

.alert-icon {
    font-size: 1.25rem;
    margin-top: 2px;
}

.alert-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 0.8rem;
    color: #475569;
}

/* Detail Page */
.detail-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.detail-header .back-link {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
}
.detail-header .back-link:hover {
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.detail-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #1e293b;
}

.detail-card h3 {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.detail-item .label {
    color: #475569;
    font-size: 0.875rem;
}

.detail-item .value {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background-color: #60a5fa;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
}
.form-control, .form-select {
    width: 100%;
    padding: 10px 16px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: #1e293b;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(19, 83, 170, 0.15);
}
.form-control::placeholder {
    color: #94a3b8;
}
.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        grid-column: 1;
        padding: 16px;
    }
    .modules-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .header-title .menu-toggle {
        display: inline-block !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.module-card, .stat-card, .chart-card, .table-card, .alert-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.module-card:nth-child(1) { animation-delay: 0.05s; }
.module-card:nth-child(2) { animation-delay: 0.10s; }
.module-card:nth-child(3) { animation-delay: 0.15s; }
.module-card:nth-child(4) { animation-delay: 0.20s; }
.module-card:nth-child(5) { animation-delay: 0.25s; }

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

.chart-card:nth-child(1) { animation-delay: 0.10s; }
.chart-card:nth-child(2) { animation-delay: 0.15s; }

.table-card { animation-delay: 0.20s; }
.alert-card { animation-delay: 0.10s; }

/* Responsive Media Queries */
@media (max-width: 768px) {
    .topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        height: auto;
    }
    
    .topbar-logo {
        font-size: 1.25rem;
    }
    
    .topbar-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-link {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box {
        flex: 1;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .charts-grid, .detail-grid, .alerts-grid {
        grid-template-columns: 1fr;
    }
}
