:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-hover: #059669;
    --dark: #0f172a;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --radius: 14px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.background-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 350px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Navbar */
.public-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    position: relative;
    z-index: 10;
}

.navbar-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-admin-link {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: 0.2s;
}

.btn-admin-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.btn-logout {
    position: absolute;
    top: 0;
    right: 0;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-logout:hover {
    background: #fca5a5;
    color: #991b1b;
}

/* Tracking Box */
.tracking-search-box {
    display: flex;
    gap: 10px;
}

.tracking-search-box input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    outline: none;
}

.tracking-search-box input:focus {
    border-color: var(--primary);
}

/* Container */
.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e0e7ff;
    color: #3730a3;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
}

.label-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    display: block;
}

.label-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    font-size: 15px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Dropzone */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #e0e7ff;
    color: var(--primary);
    border-radius: 50%;
    margin-bottom: 12px;
}

.dropzone-main-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.dropzone-sub-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    position: relative;
    z-index: 2;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.apk-badge {
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.file-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-remove-file {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-remove-file:hover {
    background: #fca5a5;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 22px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 999px;
    transition: width 0.2s ease;
}

/* Buttons */
.btn-submit {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result Box */
.result-container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.check-circle {
    width: 38px;
    height: 38px;
    background: var(--success);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.success-header h3 {
    font-size: 16px;
    color: #065f46;
    margin-bottom: 2px;
}

.success-header p {
    font-size: 13px;
    color: #047857;
}

.link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.link-box input {
    flex: 1;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    outline: none;
}

.btn-copy {
    background: #0f172a;
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #334155;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

@media (max-width: 580px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

.qr-card, .details-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.qr-card h4, .details-card h4 {
    font-size: 14px;
    color: var(--dark);
    margin-bottom: 6px;
}

.qr-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.qr-box {
    display: flex;
    justify-content: center;
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

.qr-box img {
    display: block;
    margin: 0 auto;
}

.details-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.details-list {
    list-style: none;
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.details-list li {
    word-break: break-all;
}

.btn-download-now {
    display: block;
    text-align: center;
    background: #e2e8f0;
    color: var(--dark);
    text-decoration: none;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    transition: 0.2s;
}

.btn-download-now:hover {
    background: #cbd5e1;
}

.btn-new-upload {
    width: 100%;
    background: transparent;
    border: 1.5px solid var(--border);
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-new-upload:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* History Card */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    font-size: 16px;
    color: var(--dark);
}

.btn-refresh {
    background: transparent;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-refresh:hover {
    background: #f1f5f9;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    gap: 12px;
}

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

.history-item-main {
    flex: 1;
    min-width: 0;
}

.history-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.badge-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3e8ff;
    color: #7e22ce;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid #d8b4fe;
    letter-spacing: 0.3px;
}

.badge-funcionario {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #bae6fd;
}

.history-item-name {
    font-weight: 700;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-history-copy, .btn-history-dl {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--dark);
    transition: 0.2s;
}

.btn-history-copy:hover, .btn-history-dl:hover {
    background: #e2e8f0;
}

.btn-history-delete {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-history-delete:hover {
    background: #fca5a5;
    color: #991b1b;
}

.empty-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
}
