/* 
 * Premium Dynamic Design System for Inventory Management 
 * Colors based on screenshots: Dark Blue (#1b305b), Light Green (#a4ce4e), Orange (#ff9800)
 */

:root {
    --primary-blue: #1b305b;
    --primary-blue-hover: #264380;
    --accent-green: #a4ce4e;
    --accent-orange: #ff9800;
    --bg-color: #f4f7f6;
    --text-main: #333;
    --text-light: #666;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --input-bg: #f9f9f9;
    --danger: #d32f2f;
    --danger-hover: #b71c1c;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Shadows & Glassmorphism */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Anek Gujarati', 'Outfit', sans-serif;
}

.bold {
    font-weight: 800;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: url('../images/bg-pattern.png') no-repeat center center fixed, linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    background-size: cover;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Glassmorphism utility */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* =======================================
   Sidebar / Navigation
   ======================================= */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    border-right: 1px solid var(--glass-border);
    z-index: 10;
    transition: var(--transition);
}

.sidebar-brand {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.sidebar-logo {
    width: 180px;
    /* slightly smaller logo */
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: var(--transition);
}

.sidebar-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15));
}

.brand-text {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #B8860B 0%, #D4AF37 50%, #8B6508 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-btn {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid transparent;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.nav-btn i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.nav-btn.active {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.nav-info {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(27, 48, 91, 0.1);
}

.datetime {
    text-align: center;
    color: var(--primary-blue);
    font-weight: 600;
}

#current-time {
    display: block;
    font-size: 18px;
}

#current-date {
    display: block;
    font-size: 14px;
    color: var(--text-light);
}

.icon-btn {
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--danger);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
    background: var(--danger);
    color: var(--white);
    transform: scale(1.1);
    border-color: var(--danger);
}

/* =======================================
   Main Content Layout
   ======================================= */
.main-content {
    flex: 1;
    min-width: 0;
    /* Allows container to shrink and not push off-screen */
    padding: 20px 30px;
    overflow-y: hidden;
    height: calc(100vh - 30px);
    border-radius: 20px;
    /* Fully rounded on all corners */
    margin: 15px;
    /* Equal margin all around */
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    /* Added to handle small screens gracefully */
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.section-title {
    color: var(--primary-blue);
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 700;
}

/* =======================================
   Dashboard Cards
   ======================================= */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.search-column {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
    transform: scale(1);
    transition: transform 0.5s ease;
}

.stat-card:hover::before {
    transform: scale(1.5);
}

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

.stat-icon {
    font-size: 40px;
    background: rgba(255, 255, 255, 0.2);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-content h3 {
    font-size: 14px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.9;
}

.stat-content .value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-desc {
    font-size: 12px;
    opacity: 0.8;
}

.stat-card.balance {
    background: linear-gradient(135deg, #4A00E0 0%, #8E2DE2 100%);
}

.stat-card.inward {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.outward {
    background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
}

/* Snowflakes Animation */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snowflake {
    color: var(--primary-blue);
    font-size: 1.5em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(27, 48, 91, 0.3);
    position: absolute;
    top: -10%;
    z-index: 0;
    user-select: none;
    cursor: default;
    animation-name: snowflakes-fall, snowflakes-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
}

@keyframes snowflakes-fall {
    0% {
        top: -10%;
    }

    100% {
        top: 100%;
    }
}

@keyframes snowflakes-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(80px);
    }
}

.snowflake:nth-of-type(0) {
    left: 1%;
    animation-delay: 0s, 0s;
}

.snowflake:nth-of-type(1) {
    left: 10%;
    animation-delay: 1s, 1s;
}

.snowflake:nth-of-type(2) {
    left: 20%;
    animation-delay: 6s, 0.5s;
}

.snowflake:nth-of-type(3) {
    left: 30%;
    animation-delay: 4s, 2s;
}

.snowflake:nth-of-type(4) {
    left: 40%;
    animation-delay: 2s, 2s;
}

.snowflake:nth-of-type(5) {
    left: 50%;
    animation-delay: 8s, 3s;
}

.snowflake:nth-of-type(6) {
    left: 60%;
    animation-delay: 6s, 2s;
}

.snowflake:nth-of-type(7) {
    left: 70%;
    animation-delay: 2.5s, 1s;
}

.snowflake:nth-of-type(8) {
    left: 80%;
    animation-delay: 1s, 0s;
}

.snowflake:nth-of-type(9) {
    left: 90%;
    animation-delay: 3s, 1.5s;
}

.snowflake:nth-of-type(10) {
    left: 25%;
    animation-delay: 2s, 0s;
}

.snowflake:nth-of-type(11) {
    left: 65%;
    animation-delay: 4s, 2.5s;
}

.search-panel {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
}

/* =======================================
   Forms & Inputs
   ======================================= */
.data-form {
    background: var(--white);
    padding: 15px;
    /* Reduced from 30px */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    min-height: 310px;
    display: flex;
    flex-direction: column;
}

.form-actions {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    /* Reduced from 20px */
    margin-bottom: 10px;
    /* Reduced from 20px */
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
    /* Spans half the row if 4 cols */
}

/* =======================================
   Data Tables
   ======================================= */
.tab-content.active {
    display: flex;
    flex-direction: column;
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    min-height: 150px;
    height: auto;
    margin-top: 15px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
    /* Proper border on all sides */
}

.data-table th {
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4);
}

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

.data-table tbody tr:hover {
    background-color: #f5f8fc;
}

.form-group.span-4 {
    grid-column: span 4;
    /* Spans full row */
}

.form-group.inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 10px;
}

.brand-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 4px;
    /* Reduced from 8px */
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 6px 10px;
    /* Reduced from 10px 12px */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    font-size: 13px;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(27, 48, 91, 0.1);
    background-color: var(--white);
}

input[readonly] {
    background-color: #eceff1;
    cursor: not-allowed;
    color: #546e7a;
    font-weight: 600;
}

.divider {
    border: 0;
    height: 4px;
    background-color: var(--primary-blue);
    margin: 15px 0;
    /* Reduced from 30px 0 */
    border-radius: 2px;
}

.push-right {
    margin-left: auto;
}

.center-align {
    grid-template-columns: repeat(3, 1fr);
}

/* =======================================
   Buttons
   ======================================= */
.btn {
    padding: 8px 20px;
    /* Reduced from 10px 24px */
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--transition);
}

.btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    box-shadow: 0 0 5px rgba(26,54,99,0.5);
}

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

.btn-primary:hover {
    background-color: var(--primary-blue-hover);
    box-shadow: var(--shadow-sm);
}

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

.btn-danger {
    background-color: var(--primary-blue);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 40px;
    align-items: center;
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* =======================================
   Report specific
   ======================================= */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.report-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.report-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* =======================================
   MOBILE RESPONSIVE VIEW
   Desktop view is untouched. Everything below
   only applies to screens ≤ 768px wide.
   ======================================= */
@media (max-width: 768px) {

    /* --- Layout Container --- */
    .app-container {
        flex-direction: column;
        min-height: 100dvh;
        height: auto;
        overflow-y: auto;
    }

    /* --- Sidebar / Header Bar --- */
    .sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border);
        padding: 4px 12px !important;
        flex-direction: column;
    }

    .sidebar-brand {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .sidebar-logo {
        width: 70px !important;
        margin-bottom: 0 !important;
    }

    .brand-text {
        font-size: 15px !important;
        margin: 0 !important;
    }

    .menu-toggle {
        display: block !important;
        font-size: 20px;
    }

    /* --- Nav Links (hidden until hamburger clicked) --- */
    .nav-links {
        display: none !important;
        flex-direction: column;
        width: 100%;
        padding: 5px 0;
        gap: 2px;
    }

    .nav-info {
        display: none !important;
        width: 100%;
        margin-top: 5px;
    }

    .sidebar.mobile-open .nav-links,
    .sidebar.mobile-open .nav-info {
        display: flex !important;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 13px;
    }

    /* --- Main Content Area --- */
    .main-content {
        margin: 0 !important;
        border-radius: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        flex: 1;
        padding: 8px 10px !important;
        overflow-y: visible !important;
    }

    .tab-content {
        height: auto !important;
        overflow-y: visible !important;
    }

    /* --- Dashboard --- */
    .section-title {
        margin-top: 0 !important;
        margin-bottom: 8px !important;
        font-size: 16px !important;
    }

    .dashboard-layout {
        margin-top: 0 !important;
    }

    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .stat-card {
        padding: 10px 14px !important;
        gap: 12px !important;
        border-radius: 10px !important;
    }

    .stat-card h3 {
        font-size: 11px !important;
        margin-bottom: 1px !important;
    }

    .stat-card .value {
        font-size: 20px !important;
    }

    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        border-radius: 10px !important;
    }

    .stat-card .stat-desc {
        font-size: 10px !important;
    }

    /* --- Quick Search on Dashboard (mobile compact) --- */
    .search-column {
        margin: 10px auto !important;
        padding: 15px !important;
    }

    .search-panel .input-group {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .search-panel .input-group input {
        width: 100% !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    .search-panel .input-group button {
        width: 100% !important;
        padding: 10px !important;
        font-size: 14px !important;
    }

    /* --- Forms (Inward / Outward / Rent) --- */
    .form-row {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .form-group {
        width: 100% !important;
    }

    .form-group label {
        font-size: 12px !important;
        margin-bottom: 3px !important;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    .form-actions {
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .form-actions .btn {
        width: 100% !important;
        justify-content: center;
        padding: 10px !important;
        font-size: 14px !important;
    }

    /* --- Tables --- */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        box-shadow: none !important;
        border-radius: 8px !important;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    /* --- Modals --- */
    .modal {
        width: 92% !important;
        max-width: 400px;
        padding: 18px !important;
    }

    .modal h3 {
        font-size: 18px !important;
    }

    .modal p {
        font-size: 14px !important;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* --- Report Page --- */
    .report-header {
        flex-direction: column !important;
        gap: 10px;
    }

    .report-controls {
        align-items: flex-start !important;
        width: 100%;
    }

    .report-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* --- Admin Page --- */
    .admin-card {
        padding: 12px !important;
    }

    /* --- Toasts --- */
    .toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
    }

    .toast {
        min-width: auto !important;
        width: 100%;
        font-size: 13px !important;
        padding: 10px 14px !important;
    }

    /* --- Tracking Timeline (horizontal scroll ok) --- */
    .horizontal-timeline {
        padding: 10px 5px !important;
    }

    .step-item {
        min-width: 110px !important;
    }

    .tracking-timeline {
        padding: 15px !important;
    }

    /* --- Snowflakes (hide on mobile for performance) --- */
    .snowflakes {
        display: none !important;
    }

    /* --- Form Action Buttons: Icon-only on mobile --- */
    .form-actions {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 10px !important;
    }

    .form-actions .btn {
        width: auto !important;
        min-width: 45px;
        height: 42px;
        padding: 0 12px !important;
        font-size: 16px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        border-radius: 10px !important;
    }

    .form-actions .btn .btn-text {
        display: none;
    }
}

/* Height-based responsive for small laptops / screens to prevent scroll */
@media (max-height: 700px) {
    .main-content {
        padding: 15px 20px;
    }

    .section-title {
        margin-bottom: 15px;
        font-size: 18px;
    }

    .form-row {
        margin-bottom: 12px;
        gap: 10px;
    }

    .form-group label {
        margin-bottom: 4px;
        font-size: 13px;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    select {
        padding: 6px 10px;
    }

    .form-actions {
        margin-top: 20px;
    }

    .btn {
        padding: 8px 16px;
    }

    .sidebar-brand {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .sidebar-logo {
        width: 140px;
    }
}

/* Corner Logo */
.corner-logo {
    display: none;
    /* Hide since it's now in the sidebar */
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    width: 350px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal {
    transform: translateY(-30px);
}

.modal h3 {
    margin-top: 0;
    color: var(--primary-blue);
    font-size: 22px;
}

.modal p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    min-width: 250px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInRight 0.3s ease forwards;
    transition: opacity 0.3s ease;
}

.toast.success {
    background-color: var(--accent-green);
    border-left: 6px solid #82aa30;
}

.toast.error {
    background-color: var(--danger);
    border-left: 6px solid var(--danger-hover);
}

.toast.info {
    background-color: var(--primary-blue);
    border-left: 6px solid #102042;
}

.toast .close-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.toast .close-btn:hover {
    opacity: 1;
}

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

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

/* =======================================
   Data Tables
   ======================================= */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
}

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

.data-table tbody tr:hover {
    background-color: #f5f8fc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* =======================================
   Tracking Timeline
   ======================================= */
.tracking-timeline {
    position: relative;
    padding: 20px 0;
    margin-top: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.tracking-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracking-header h3 {
    color: var(--primary-blue);
    font-size: 22px;
}

.tracking-timeline-list {
    position: relative;
    padding-left: 40px;
}

.tracking-timeline-list::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 4px;
    background: #e0e0e0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease forwards;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 10px;
    z-index: 2;
    box-shadow: 0 0 0 3px var(--white);
}

.timeline-item.inward .timeline-dot {
    border-color: #38ef7d;
    color: #38ef7d;
}

.timeline-item.outward .timeline-dot {
    border-color: #f5af19;
    color: #f5af19;
}

.timeline-item.rent .timeline-dot {
    border-color: #8E2DE2;
    color: #8E2DE2;
}

.timeline-content {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-blue);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
}

.timeline-item.inward .timeline-content {
    border-left-color: #38ef7d;
}

.timeline-item.outward .timeline-content {
    border-left-color: #f5af19;
}

.timeline-item.rent .timeline-content {
    border-left-color: #8E2DE2;
}

.timeline-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.timeline-date {
    font-size: 10px;
    color: #666;
    font-weight: 600;
}

.timeline-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    font-size: 11px;
}

.timeline-detail-item {
    display: flex;
    flex-direction: column;
}

.timeline-detail-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

.timeline-detail-value {
    font-weight: 700;
    color: var(--text-main);
}


/* Quick Search & Tracking Panel */
.search-column {
    max-width: 600px;
    margin: 40px auto 20px auto;
    background: var(--white);
    padding: 25px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.search-column h3 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.search-panel {
    margin-bottom: 20px;
}

.search-panel .input-group {
    display: flex;
    gap: 12px;
}

.search-panel .input-group input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.search-panel .input-group input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(16, 32, 66, 0.1);
    outline: none;
}

.search-panel .input-group button {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
}

/* Horizontal Tracking Timeline */
.horizontal-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px 10px;
    overflow-x: auto;
    gap: 0;
    min-width: 100%;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 130px;
    text-align: center;
    flex-shrink: 0;
}

.step-icon {
    font-size: 20px;
    color: var(--primary-blue);
    margin-bottom: 8px;
    background: #f0f4ff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-item.inward .step-icon {
    color: #38ef7d;
    background: #e8fcf0;
}

.step-item.outward .step-icon {
    color: #f5af19;
    background: #fef7e8;
}

.step-item.rent .step-icon {
    color: #8E2DE2;
    background: #f4ebfc;
}

.step-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.step-date {
    font-size: 10px;
    color: #888;
    margin-bottom: 12px;
}

.step-dot-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.step-dot {
    width: 20px;
    height: 20px;
    background: #0b6911;
    /* Dark green for completed */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.step-dot.pending {
    background: #e0e0e0;
    color: #888;
}

.step-connector {
    height: 4px;
    background: #0b6911;
    width: 60px;
    /* Fixed width instead of flex-grow to reduce space */
    flex-shrink: 0;
    margin-top: 96px;
    /* Align with dots */
    z-index: 1;
}

.step-connector.pending {
    background: #e0e0e0;
}

.step-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
    font-size: 11px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    /* Stronger shadow for dynamic look */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.step-item.inward .step-details {
    border-top: 3px solid #38ef7d;
}

.step-item.outward .step-details {
    border-top: 3px solid #f5af19;
}

.step-item.rent .step-details {
    border-top: 3px solid #8E2DE2;
}

.step-detail-row {
    display: flex;
    justify-content: space-between;
}

.step-detail-row span:first-child {
    color: #666;
    margin-right: 8px;
}

.step-detail-row span:last-child {
    font-weight: 600;
    color: #222;
}

.step-detail-row.amount span:last-child {
    color: var(--danger);
    font-size: 12px;
}

.login-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('../images/bg-pattern.png') no-repeat center center fixed, linear-gradient(135deg, #1b305b 0%, #0a1426 100%);
    background-size: cover;
    z-index: 9999;
    position: fixed;
    top: 0;
    left: 0;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.6s ease-out;
}

.login-logo-wrapper {
    margin-bottom: 20px;
}

.login-logo {
    width: 200px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    animation: pulse 2s infinite ease-in-out alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

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

#app-login-pin {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--primary-blue);
}

#app-login-pin:focus {
    background: #fff;
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.3);
}
[data-theme='dark'] {
    --primary-blue: #1e3a8a;
    --primary-blue-hover: #3b82f6;
    --accent-green: #4ade80;
    --accent-orange: #fbbf24;
    --bg-color: #121212;
    --text-main: #e0e0e0;
    --text-light: #a0a0a0;
    --white: #1e1e1e;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: #2d2d2d;
    --glass-bg: rgba(30, 30, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

[data-theme='dark'] input,
[data-theme='dark'] select,
[data-theme='dark'] textarea {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

[data-theme='dark'] table th {
    background: #1e1e1e;
    color: #e0e0e0;
}

[data-theme='dark'] table td {
    border-bottom-color: var(--border-color);
}

[data-theme='dark'] .sidebar-logo {
    filter: brightness(0) invert(1);
}

[data-theme='dark'] #login-overlay .modal {
    background: rgba(30,30,30,0.97) !important;
    color: #e0e0e0;
}
[data-theme='dark'] #login-overlay h2 {
    color: #e0e0e0 !important;
}
[data-theme='dark'] #login-overlay label {
    color: #e0e0e0 !important;
}
[data-theme='dark'] #login-overlay select,
[data-theme='dark'] #login-overlay input {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

