:root {
    --primary-color: #0082c9; /* Correios Cargo Blue */
    --primary-hover: #006da8;
    --bg-color: #f1f4f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --pix-color: #32bcad;
    --correios-yellow: #ffcc00;
    --correios-blue: #00416a;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #f4f7fa;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinha ao topo */
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

#app-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 540px;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    text-align: center;
    overflow: hidden;
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Animations */
.screen {
    display: none;
    opacity: 0;
    transform: scale(0.98) translateY(10px);
}

.screen.active {
    display: block;
    animation: screenEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenEnter {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Typography */
h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.logo {
    font-size: 36px;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo span {
    background: linear-gradient(135deg, var(--primary-color), var(--correios-yellow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

input, select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 82, 186, 0.08);
    outline: none;
}

/* Buttons */
button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 14px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(15, 82, 186, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(15, 82, 186, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: #f1f5f9;
    color: var(--text-main);
}

.secondary-btn:hover {
    background: #e2e8f0;
}

.text-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px;
}

.text-btn:hover {
    color: var(--primary-color);
}

/* Loggi Style Full Page Hero */
.loggi-main-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.loggi-main-screen.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loggi-header {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    box-sizing: border-box; /* Garante que padding não estoure a largura total se não usado antes */
    position: sticky;
    top: 0;
    z-index: 100;
}

.loggi-header .logo {
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%; /* Toma a altura do header */
    padding: 15px 0; /* Dá respiro em cima e embaixo */
    box-sizing: border-box;
}

.loggi-header .logo img {
    height: 100%; /* Respeita a altura do container logo, que desconta o padding */
    width: auto;      /* Mantém a proporção */
    max-width: 350px; /* Limite de largura de segurança */
    object-fit: contain;
    transition: transform 0.3s ease;
}

.loggi-header .logo img:hover {
    transform: scale(1.02);
}

.loggi-nav a {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.2s;
}

.loggi-nav a:hover {
    background: rgba(15, 82, 186, 0.05);
}

.loggi-hero-section {
    width: 100%;
    background: url('assets/banner_correios_cargo.png') center/cover no-repeat;
    position: relative;
    padding: 60px 20px 80px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Height of the screen minus header (120px) minus footer (approx. 80px) */
    min-height: calc(100vh - 200px);
    border-bottom: 6px solid var(--correios-yellow);
    box-sizing: border-box;
    margin: 0;
}

.loggi-hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0, 65, 106, 0.85) 0%, rgba(0, 130, 201, 0.75) 100%);
    z-index: 1;
}

.loggi-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 750px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 50px 40px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.loggi-hero-content h1 {
    font-size: 54px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 16px 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.loggi-hero-content p {
    font-size: 22px;
    color: #f1f5f9;
    margin: 0 0 45px 0;
    line-height: 1.5;
    font-weight: 400;
    text-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.loggi-search-box {
    display: flex;
    background: #ffffff;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    margin: 0 auto;
    width: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
}

.loggi-search-box:focus-within {
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.loggi-search-box input {
    border: none;
    border-radius: 12px;
    background: transparent;
    padding: 20px 24px;
    font-size: 18px;
    flex: 1;
    min-width: 0;
    color: var(--text-main);
    font-weight: 500;
}

.loggi-search-box input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.loggi-search-box input:focus {
    box-shadow: none;
    background: transparent;
}

.loggi-search-box button {
    background: var(--correios-yellow);
    color: var(--correios-blue);
    border: none;
    border-radius: 14px;
    margin: 0;
    padding: 0 40px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    width: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loggi-search-box button:hover {
    background: #ffd633;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.5);
}

/* --- Tema Correios --- */
.correios-theme {
    text-align: left;
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    color: #333;
}

.correios-header-fake {
    background: #fcfcfc;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.correios-header-fake img {
    height: 24px;
}

.tracking-code-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--correios-blue);
    margin-bottom: 20px;
    font-family: Arial, sans-serif;
}

/* --- Modern Tracking Screen --- */
/* Force FULL isolation for the tracking screen */
body > .tracking-modern-screen {
    background: #f4f7fa !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999999 !important; /* Extremely high z-index */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    /* Reset any inherited flex-item behavior */
    flex: none !important;
    order: -1 !important; /* Move to start if flexed */
}

/* Ensure the tracking header is truly full width */
.tracking-top-header {
    width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
}


.tracking-modern-screen.active {
    display: flex;
}

.tracking-top-header {
    width: 100%;
    box-sizing: border-box;
    background: var(--correios-blue);
    padding: 20px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tracking-top-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.registration-top-header {
    width: 100%;
    box-sizing: border-box;
    background: var(--correios-blue);
    padding: 20px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.registration-form-content {
    padding: 30px 20px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.main-registration-screen {
    background: #fff !important;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 200 !important;
    overflow-y: auto !important;
    display: none;
    flex-direction: column;
}

.main-registration-screen.active {
    display: flex;
}

.back-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    width: auto;
    margin: 0;
}

.header-title {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}

#tracking-data {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tracking-summary-card {
    background: white;
    border-radius: 24px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.tracking-code-badge {
    display: inline-block;
    background: #edf2f7;
    color: var(--correios-blue);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 12px;
}

.current-status-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--correios-blue);
    margin-bottom: 5px;
    line-height: 1.2;
}

.current-status-date {
    font-size: 14px;
    color: var(--text-muted);
}

/* Premium Progress Stepper */
.progress-section {
    padding: 40px 0;
    margin-bottom: 20px;
}

.modern-progress-bar {
    position: relative;
    padding: 0 20px;
}

.progress-track {
    position: absolute;
    top: 22px;
    left: 40px;
    right: 40px;
    height: 10px;
    background: #e5eef5;
    border-radius: 10px;
    z-index: 1;
}

.progress-fill {
    position: absolute;
    top: 22px;
    left: 40px;
    height: 10px;
    background: linear-gradient(90deg, var(--correios-yellow), #ffd633);
    border-radius: 10px;
    z-index: 2;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(255, 214, 51, 0.3);
}

.progress-nodes {
    position: relative;
    display: flex;
    justify-content: space-between;
    z-index: 3;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90px;
    text-align: center;
}

.node-dot {
    width: 44px;
    height: 44px;
    background: #fff;
    border: 3px solid #e5eef5;
    border-radius: 16px; /* Squircle style */
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.node.active .node-dot {
    border-color: var(--correios-yellow);
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 204, 0, 0.25);
}

.node.done .node-dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.node-label {
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.node.active .node-label {
    color: var(--correios-blue);
}

/* Info Cards */
.info-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.info-card {
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.info-card-header {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-card-body .highlight {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

/* History List */
.history-section {
    margin-top: 30px;
}

.history-section h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--correios-blue);
    margin-bottom: 15px;
}

.modern-history-list {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.modern-history-list li {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f7fafc;
    gap: 15px;
}

.history-col-1 {
    min-width: 80px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1.4;
}

.history-col-2 {
    flex: 1;
}

.history-col-2 strong {
    display: block;
    font-size: 14px;
    color: var(--correios-blue);
    margin-bottom: 2px;
}

.sub-info {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Alert Tax */
.tax-card-alert {
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert-content {
    display: flex;
    gap: 15px;
}

.alert-icon {
    font-size: 24px;
}

.alert-text strong {
    color: #c53030;
    font-size: 16px;
}

.alert-text p {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: #742a2a;
}

.alert-action-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

/* Loader */
.modern-loader-container {
    padding: 60px 20px;
    text-align: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--correios-blue);
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tracking-actions-footer {
    padding: 30px 0;
}

/* Utils */
.mt-4 { margin-top: 20px; }

/* Progress Bar Horizontal */
.correios-progress-container {
    position: relative;
    margin: 50px 0 30px 0;
    padding: 0 10px;
}

.correios-progress-line {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
}

.correios-progress {
    position: relative;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.progress-icon {
    width: 44px;
    height: 44px;
    background: #fff;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.progress-step.active .progress-icon {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.1);
}

.progress-step.active .progress-icon.check-icon {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.progress-step .label {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-step.active .label {
    color: var(--primary-color);
}

/* Truck Loader Animado */
.truck-animation-container {
    position: relative;
    width: 200px;
    height: 80px;
    margin: 0 auto;
    overflow: hidden;
}

.truck-icon {
    font-size: 50px;
    position: absolute;
    bottom: 10px;
    left: 50%;
    margin-left: -25px;
    animation: truckBounce 0.8s ease-in-out infinite alternate;
}

.road-line {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.road-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    background: var(--primary-color);
    box-shadow: 60px 0 0 var(--primary-color), 120px 0 0 var(--primary-color), 180px 0 0 var(--primary-color);
    animation: roadMove 1.2s linear infinite;
}

@keyframes truckBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px) rotate(-1deg); }
}

@keyframes roadMove {
    0% { transform: translateX(200px); }
    100% { transform: translateX(-100px); }
}


/* History List */
.correios-history {
    background: #f8fafc;
    border-radius: 16px;
    padding: 5px;
    margin-top: 20px;
}

.correios-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.correios-history li {
    display: flex;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    transition: background 0.3s;
}

.correios-history li:hover {
    background: rgba(255,255,255,0.5);
}

.history-col-1 {
    width: 100px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.history-col-2 {
    flex: 1;
    padding-left: 20px;
}

.history-col-2 strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    margin-bottom: 4px;
}

/* Admin Table Styling */
.dashboard-cards-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.dashboard-card {
    flex: 1;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.card-icon.warning {
    background: #fffbeb;
    color: var(--warning);
}

.card-info h3 {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.card-info p {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: #f8fafc;
    padding: 15px;
    font-weight: 600;
    text-align: left;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: white;
    padding: 16px 28px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* PIX Styles */
.pix-container {
    padding: 30px;
    background: #f8fafc;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.qr-code-box {
    width: 220px;
    height: 220px;
    margin: 0 auto 20px auto;
    background: white;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.pix-copy-box {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.pix-copy-box:hover {
    border-color: var(--pix-color);
    background: #f0fdfa;
}

/* Footer Seal */
.loggi-footer {
    width: 100%;
    background: #ffffff;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Push to bottom if content is short */
}

.footer-seal-container {
    display: inline-block;
    padding: 10px;
}

.footer-seal {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    filter: grayscale(10%) contrast(1.1); /* Slight enhancement */
    transition: transform 0.3s ease;
}

.footer-seal:hover {
    transform: scale(1.05);
}

 

/* =========================================
   MODERN LOGIN SCREEN
   ========================================= */

.login-modern-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, #f8fafc, #e2e8f0);
    min-height: 100%;
}

.login-modern-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 0 auto;
    box-sizing: border-box;
}

.login-modern-header {
    margin-bottom: 30px;
}

.login-modern-icon {
    font-size: 40px;
    color: var(--primary-color);
    background: #eff6ff;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.login-modern-card .input-group {
    margin-bottom: 20px;
}

.login-modern-card .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    text-align: left;
}

.modern-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    color: var(--text-main);
}

.modern-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 130, 201, 0.1);
    outline: none;
}

.modern-btn {
    margin-top: 10px;
    padding: 16px;
    font-size: 16px;
    border-radius: 12px;
    background: var(--primary-color);
    width: 100%;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px -5px rgba(0, 130, 201, 0.3);
}

.modern-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(0, 130, 201, 0.4);
}

.modern-text-btn {
    margin-top: 15px;
    font-weight: 500;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s;
}

.modern-text-btn:hover {
    color: var(--primary-color);
}

/* =========================================
   SaaS ADMIN DASHBOARD STYLES
   ========================================= */

/* SaaS Variables */
:root {
    --saas-bg: #f3f4f6;
    --saas-surface: #ffffff;
    --saas-primary: #2563eb;
    --saas-primary-hover: #1d4ed8;
    --saas-success: #10b981;
    --saas-danger: #ef4444;
    --saas-warning: #f59e0b;
    --saas-text-main: #111827;
    --saas-text-muted: #6b7280;
    --saas-border: #e5e7eb;
    --saas-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --saas-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --saas-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --saas-radius: 12px;
}

/* Base Layout Override for Admin */
.admin-saas-layout {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--saas-bg);
    z-index: 1000;
    flex-direction: row; /* Sidebar + Main */
    color: var(--saas-text-main);
    font-family: 'Outfit', sans-serif;
    text-align: left;
}

.admin-saas-layout.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

/* Sidebar */
.saas-sidebar {
    width: 260px;
    background: var(--saas-surface);
    border-right: 1px solid var(--saas-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: var(--saas-shadow-sm);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--saas-border);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--saas-primary);
}

.sidebar-header h3 span {
    color: var(--saas-text-main);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--saas-text-muted);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-nav a .icon {
    font-size: 18px;
    margin-right: 12px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #eff6ff;
    color: var(--saas-primary);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--saas-border);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--saas-danger);
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-footer a:hover {
    background: #fef2f2;
}

/* Main Workspace */
.saas-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Topbar */
.saas-topbar {
    height: 72px;
    background: var(--saas-surface);
    border-bottom: 1px solid var(--saas-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--saas-bg);
    border-radius: 8px;
    padding: 8px 16px;
    width: 350px;
    border: 1px solid var(--saas-border);
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--saas-primary);
    background: var(--saas-surface);
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 4px 8px;
    width: 100%;
    font-size: 14px;
    color: var(--saas-text-main);
    outline: none;
}

.search-bar input:focus {
    box-shadow: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--saas-text-muted);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    width: auto;
}

.icon-btn:hover {
    background: var(--saas-bg);
    color: var(--saas-primary);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.admin-profile .avatar {
    width: 36px;
    height: 36px;
    background: var(--saas-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.admin-profile span {
    font-weight: 600;
    font-size: 14px;
}

/* Content Area */
.saas-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: none;
}

.saas-content.active {
    display: block;
}

.saas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.saas-header h2 {
    font-size: 28px;
    color: var(--saas-text-main);
    margin: 0;
}

.saas-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    width: auto;
    margin: 0;
    box-shadow: var(--saas-shadow-sm);
}

/* Metrics Grid */
.saas-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.saas-metrics-grid .metric-card {
    background: var(--saas-surface);
    border-radius: var(--saas-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--saas-shadow);
    border: 1px solid var(--saas-border);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.metric-icon.blue { background: #eff6ff; color: var(--saas-primary); }
.metric-icon.orange { background: #fff7ed; color: var(--saas-warning); }
.metric-icon.green { background: #ecfdf5; color: var(--saas-success); }
.metric-icon.red { background: #fef2f2; color: var(--saas-danger); }

.metric-info p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--saas-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-info h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--saas-text-main);
}

/* Modern Table Container */
.saas-table-container {
    background: var(--saas-surface);
    border-radius: var(--saas-radius);
    box-shadow: var(--saas-shadow);
    border: 1px solid var(--saas-border);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--saas-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    font-size: 18px;
}

.table-filters select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--saas-border);
    font-size: 14px;
    width: auto;
    background: #f9fafb;
    outline: none;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.saas-table th {
    background: #f9fafb;
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--saas-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--saas-border);
}

.saas-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--saas-text-main);
    border-bottom: 1px solid var(--saas-border);
    vertical-align: middle;
}

.saas-table tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.badge-transit { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.badge-delivered { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }
.badge-blocked { background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; }
.badge-none { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

/* Table Actions */
.action-group {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 1px solid var(--saas-border);
    color: var(--saas-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--saas-bg);
    color: var(--saas-primary);
    border-color: var(--saas-border);
}

.table-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid var(--saas-border);
    font-size: 14px;
    color: var(--saas-text-muted);
    text-align: center;
}

/* Timeline & Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.details-card {
    background: var(--saas-surface);
    border-radius: var(--saas-radius);
    padding: 24px;
    box-shadow: var(--saas-shadow);
    border: 1px solid var(--saas-border);
}

.details-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid var(--saas-border);
    padding-bottom: 12px;
}

.details-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--saas-border);
}

.details-info-row span.label {
    color: var(--saas-text-muted);
    font-weight: 500;
}

.details-info-row span.value {
    color: var(--saas-text-main);
    font-weight: 600;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Timeline specific */
.timeline-container {
    background: var(--saas-surface);
    border-radius: var(--saas-radius);
    padding: 24px;
    box-shadow: var(--saas-shadow);
    border: 1px solid var(--saas-border);
}

.tracking-timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    top: 5px; left: 7px;
    bottom: 0;
    width: 2px;
    background: var(--saas-border);
}

.timeline-event {
    position: relative;
    padding-bottom: 24px;
}

.timeline-event:last-child {
    padding-bottom: 0;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--saas-surface);
    border: 2px solid #94a3b8;
    z-index: 1;
}

.timeline-event.completed::before {
    background: var(--saas-success);
    border-color: var(--saas-success);
}

.timeline-event.active::before {
    border-color: var(--saas-primary);
    background: var(--saas-surface);
    border-width: 3px;
}

.timeline-date {
    font-size: 12px;
    color: var(--saas-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
}

.timeline-status {
    font-size: 15px;
    font-weight: 700;
    color: var(--saas-text-main);
    margin-bottom: 4px;
}

.timeline-location {
    font-size: 13px;
    color: var(--saas-text-muted);
}


/* =============================================
   MOBILE RESPONSIVENESS
   ============================================= */

/* Loggi Main Screen - Mobile */
@media (max-width: 768px) {
    .loggi-header {
        height: 80px;
        padding: 0 4%;
    }

    .loggi-header .logo img {
        height: 100%;
        max-width: 200px;
    }

    .loggi-nav a {
        font-size: 14px;
        padding: 8px 14px;
    }

    .loggi-hero-section {
        padding: 30px 16px 50px 16px;
        min-height: calc(100vh - 160px);
    }

    .loggi-hero-content {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .loggi-hero-content h1 {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .loggi-hero-content p {
        font-size: 16px;
        margin-bottom: 28px;
    }

    .loggi-search-box {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    .loggi-search-box input {
        padding: 16px 18px;
        font-size: 16px;
        border-radius: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .loggi-search-box button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        border-radius: 14px;
    }

    .loggi-footer {
        padding: 20px 16px;
    }

    .footer-seal {
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .loggi-header {
        height: 65px;
        padding: 0 3%;
    }

    .loggi-header .logo img {
        max-width: 150px;
    }

    .loggi-hero-content h1 {
        font-size: 26px;
    }

    .loggi-hero-content p {
        font-size: 14px;
    }
}

/* Tracking Screen - Mobile */
@media (max-width: 768px) {
    .tracking-top-header {
        padding: 18px 4% !important;
    }

    .tracking-top-nav {
        gap: 12px !important;
    }

    .header-title {
        font-size: 16px;
    }

    #tracking-data {
        padding: 16px;
    }

    .tracking-summary-card {
        border-radius: 20px;
        padding: 20px;
    }

    .current-status-text {
        font-size: 18px;
    }

    .progress-section {
        padding: 24px 0;
    }

    .node {
        width: 70px;
    }

    .node-dot {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 12px;
    }

    .node-label {
        font-size: 10px;
    }

    .info-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .info-card {
        padding: 12px;
    }

    .modern-history-list li {
        flex-direction: column;
        gap: 6px;
    }

    .history-col-1 {
        min-width: unset;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .info-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin Panel - Mobile fixes */
@media (max-width: 900px) {
    .saas-sidebar {
        display: none;
    }

    .admin-saas-layout {
        grid-template-columns: 1fr !important;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}
