/* Main Stylesheet for Delivery Management System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

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

:root {
    /* Refined Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* Neutrals */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #020617;
    --text-muted: #334155;
    --border-color: #cbd5e1;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 10px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2);
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Sidebar */
    --sidebar-w: 260px;
    --sidebar-bg: #1e1e2d;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background-color: var(--sidebar-bg);
    color: #a2a3b7;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 24px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
    display: inline-block;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #a2a3b7;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-menu li.active>a {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-menu i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.7;
}

.sidebar-menu li.active i {
    opacity: 1;
}

/* Sub-menu Styles */
.has-submenu>.submenu {
    display: none;
    list-style: none;
    padding: 4px 0 4px 40px;
}

.has-submenu.open>.submenu {
    display: block;
}

.submenu a {
    padding: 8px 16px;
    font-size: 0.813rem;
    opacity: 0.8;
}

.submenu a:hover {
    opacity: 1;
    background: transparent;
    color: #fff;
}

/* Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-body {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Main UI Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.875rem;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary,
.btn:not(.btn-outline):not(.btn-danger) {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn:not(.btn-outline):not(.btn-danger):hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

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

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--secondary);
    color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 8px;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background-color: #fff;
    color: var(--text-main);
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.938rem;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    color: #991b1b;
    background-color: #fef2f2;
    border-color: #fee2e2;
}

.alert-success {
    color: #065f46;
    background-color: #ecfdf5;
    border-color: #d1fae5;
}

/* Action Utilities & Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Custom Grid */
.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

[class*="col-"] {
    grid-column: span 12;
}

@media (min-width: 768px) {
    .col-md-3 {
        grid-column: span 3;
    }

    .col-md-4 {
        grid-column: span 4;
    }

    .col-md-6 {
        grid-column: span 6;
    }

    .col-md-8 {
        grid-column: span 8;
    }

    .col-md-12 {
        grid-column: span 12;
    }
}

/* Stats Dashboard Enhancements */
.stat-card {
    padding: 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.stat-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.25;
    transform: rotate(-15deg);
    color: #fff;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: #fff;
}

.stat-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.813rem;
    opacity: 0.95;
    color: #fff;
}

/* Dashboard Action Tiles */
.dashboard-tile {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 24px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: #fff !important;
    min-height: 200px !important;
    width: 100%;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.dashboard-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.dashboard-tile i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 1;
    display: block;
}

.dashboard-tile span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
    line-height: 1.2;
}

.dashboard-tile small {
    display: block;
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Login Page Revamp */
.login-body {
    background: radial-gradient(circle at top right, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.login-header {
    padding: 48px 40px 32px;
    text-align: center;
}

.login-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1px;
}

.login-content {
    padding: 0 40px 48px;
}

/* Utils */
.d-flex {
    display: flex !important;
}

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

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

.flex-wrap {
    flex-wrap: wrap !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

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

.fw-bold {
    font-weight: 700 !important;
}

.welcome-section {
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.h5 {
    font-size: 1.25rem;
    font-weight: 600;
}

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

.text-gray-500 {
    color: #9ca3af !important;
}

.g-4 {
    margin-right: -1rem;
    margin-left: -1rem;
}

.g-4>[class*="col-"] {
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Action Buttons & Utilities */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #4b5563;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    padding: 16px;
    border-radius: 12px;
}

.action-btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: white;
    font-size: 1.25rem;
}

.bg-primary {
    background-color: #4361ee !important;
}

.bg-success {
    background-color: #4cc9f0 !important;
}

.bg-info {
    background-color: #4895ef !important;
}

.bg-warning {
    background-color: #ff9f1c !important;
}

.bg-secondary {
    background-color: #3f37c9 !important;
}

.text-dark {
    color: #1f2937 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -var(--sidebar-w);
        z-index: 1000;
        height: 100vh;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
    }

    .content-body {
        padding: 20px;
    }
}

/* Mobile Responsiveness Improvements */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .navbar {
        padding: 0 15px;
    }

    .nav-links {
        gap: 15px;
    }
}