
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f9fafb;
}

/* ========== LOGIN ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 28px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 14px;
    color: #6b7280;
}

.fg {
    margin-bottom: 16px;
}

.fg label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.fg input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.fg input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.login-help {
    margin-top: 24px;
    padding: 14px;
    background: #f3f4f6;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

.login-help strong {
    color: #374151;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-ok {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-err {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* ========== APP LAYOUT ========== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-brand span {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
}

.menu-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 12px 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.menu-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.menu-link.active {
    background: #ede9fe;
    color: #7c3aed;
    font-weight: 600;
}

.menu-link .micon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu-link.admin {
    color: #ef4444;
}

.menu-link.admin:hover {
    background: #fee2e2;
}

.menu-link.admin.active {
    background: #fee2e2;
    color: #dc2626;
}

.sidebar-user {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #9ca3af;
}

/* ========== MAIN ========== */
.main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== TOPBAR ========== */
.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.topbar-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.topbar-btn.exit {
    color: #ef4444;
    border-color: #fecaca;
}

.topbar-btn.exit:hover {
    background: #fef2f2;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
}

/* ========== CONTENT ========== */
.content {
    flex: 1;
    padding: 28px 24px;
    max-width: 1400px;
    width: 100%;
}

.page-title {
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.page-title p {
    font-size: 14px;
    color: #6b7280;
}

/* ========== CARDS ========== */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.card-head h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.card-body {
    padding: 20px;
}

.card-body.np {
    padding: 0;
}

/* ========== STATS ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 14px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.c1 {
    background: #ede9fe;
}

.stat-icon.c2 {
    background: #dbeafe;
}

.stat-icon.c3 {
    background: #d1fae5;
}

.stat-data {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

/* ========== TABLE ========== */
.tbl-wrap {
    overflow-x: auto;
}

.tbl {
    width: 100%;
    border-collapse: collapse;
}

.tbl thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.tbl tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.tbl tbody tr:last-child td {
    border-bottom: none;
}

.tbl tbody tr:hover {
    background: #fafafa;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-pri {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-pri:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.btn-ok {
    background: #10b981;
    color: white;
}

.btn-ok:hover {
    background: #059669;
}

.btn-err {
    background: #ef4444;
    color: white;
}

.btn-err:hover {
    background: #dc2626;
}

.btn-ghost {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.btn-ghost:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-ok {
    background: #d1fae5;
    color: #065f46;
}

.badge-err {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

/* ========== FORM GRID ========== */
.fgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.fg select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
}

/* ========== PLATAFORMAS ========== */
.plat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.plat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.plat-head {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.plat-head h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.plat-body {
    padding: 16px 20px;
}

.plat-body .fg {
    margin-bottom: 12px;
}

.plat-body .fg label {
    font-size: 11px;
}

.plat-body .fg input {
    padding: 8px 12px;
    font-size: 13px;
}

.cols2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.plat-result {
    margin-top: 12px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.plat-result-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.plat-result-value {
    font-size: 24px;
    font-weight: 800;
}

.plat-result-value.pos {
    color: #10b981;
}

.plat-result-value.neg {
    color: #ef4444;
}

/* ========== PRODUCT BAR ========== */
.prod-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pb-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pb-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

.pb-value {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.pb-sep {
    width: 1px;
    height: 30px;
    background: #e5e7eb;
}

/* ========== EMPTY STATE ========== */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty h3 {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
}

.empty p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== OVERLAY ========== */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.overlay.show {
    display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 20px 16px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .fgrid {
        grid-template-columns: 1fr;
    }
    
    .plat-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .prod-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pb-sep {
        width: 100%;
        height: 1px;
    }
}
