﻿/* Admin Styles - Truck Supplier */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    overflow-x: hidden;
}

/* LOGIN PAGE */
.login-page {
    background: linear-gradient(135deg, #1a5f2a, #0e3d1a);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeInUp 0.6s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

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

.login-header h2 {
    color: #1a5f2a;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.login-form label i {
    width: 20px;
    color: #1a5f2a;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #1a5f2a;
    box-shadow: 0 0 0 3px rgba(26,95,42,0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1a5f2a, #0e3d1a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26,95,42,0.3);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.login-footer a:hover {
    color: #1a5f2a;
}

/* ADMIN LAYOUT */
.admin-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    height: 50px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(26,95,42,0.3);
    color: white;
    border-left: 3px solid #1a5f2a;
}

.nav-item.logout {
    margin-top: 50px;
    color: #ff6b6b;
}

.nav-item.logout:hover {
    background: rgba(255,107,107,0.1);
}

.badge {
    background: #ff6b6b;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: auto;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 20px;
    overflow-x: hidden;
}

.top-bar {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-bar h1 {
    font-size: 24px;
    color: #333;
}

.date-time {
    color: #666;
    font-size: 14px;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.stat-info p {
    color: #666;
    margin-top: 5px;
}

/* CHARTS */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: #333;
}

/* RECENT CONTACTS */
.recent-contacts {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-view-all {
    color: #1a5f2a;
    text-decoration: none;
    font-weight: 500;
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px;
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.tr-new {
    background: #fff8e1;
}

/* STATUS BADGES */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-novo {
    background: #ff9800;
    color: white;
}

.status-lido {
    background: #2196f3;
    color: white;
}

.status-respondido {
    background: #4caf50;
    color: white;
}

.status-arquivado {
    background: #999;
    color: white;
}

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-view {
    background: #2196f3;
    color: white;
}

.btn-reply {
    background: #4caf50;
    color: white;
}

.btn-archive {
    background: #ff9800;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-action:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* FILTERS */
.filters-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-group {
    display: flex;
    gap: 5px;
}

.search-group button {
    padding: 8px 15px;
    background: #1a5f2a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-clear {
    padding: 8px 12px;
    background: #f44336;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

/* CONTACT DETAILS */
.contact-details {
    max-width: 900px;
    margin: 0 auto;
}

.detail-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.detail-card h3 {
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.detail-item span {
    color: #333;
    font-size: 14px;
}

.message-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.assunto-tag {
    display: inline-block;
    padding: 6px 15px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 20px;
    font-size: 14px;
}

.action-buttons-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-action-large {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-reply {
    background: #4caf50;
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-mark {
    background: #2196f3;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-back {
    padding: 8px 15px;
    background: #666;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

.btn-action-large:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* BULK ACTIONS */
.table-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.btn-bulk {
    padding: 8px 15px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-bulk-danger {
    background: #f44336;
}

.total-count {
    color: #666;
    font-size: 14px;
}

/* RESPONSIVE */
@media screen and (max-width: 768px) {
    /* ---- LAYOUT: empilha sidebar em cima do conteÃºdo ---- */
    .admin-container {
        flex-direction: column;
        display: flex;
    }

    /* ---- SIDEBAR: vira barra horizontal ---- */
    .sidebar {
        position: static;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }

    .sidebar-header {
        padding: 8px 12px;
        border-bottom: none;
        border-right: 1px solid rgba(255,255,255,0.1);
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .sidebar-logo {
        height: 28px;
        display: block;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        padding: 0;
        flex: 1;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
    }

    .nav-item {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
        gap: 3px;
        text-align: center;
        font-size: 9px;
        min-width: 52px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .nav-item i {
        font-size: 16px;
        display: block;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid #1a5f2a;
        background: rgba(26,95,42,0.25);
    }

    .nav-item.logout {
        margin-top: 0;
        margin-left: auto;
    }

    .badge {
        font-size: 9px;
        padding: 1px 5px;
        margin-left: 2px;
    }

    /* ---- MAIN CONTENT ---- */
    .main-content {
        width: 100%;
        padding: 10px;
    }

    /* ---- TOP BAR ---- */
    .top-bar {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .top-bar h1 {
        font-size: 18px;
    }

    .date-time {
        font-size: 12px;
    }

    /* ---- STATS ---- */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

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

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        flex-shrink: 0;
        border-radius: 8px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .stat-info p {
        font-size: 11px;
    }

    /* ---- CHARTS ---- */
    .charts-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .chart-card {
        padding: 12px;
        border-radius: 10px;
    }

    /* ---- TABLES ---- */
    .data-table th,
    .data-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    /* ---- DETAIL ---- */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons-container {
        flex-direction: column;
    }

    .btn-action-large {
        min-width: 100%;
    }

    /* ---- RECENT CONTACTS ---- */
    .recent-contacts {
        border-radius: 10px;
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 6px;
    }

    .data-table th,
    .data-table td {
        font-size: 11px;
        padding: 6px 6px;
    }

    .top-bar h1 {
        font-size: 16px;
    }
}


/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Level Badge */
.level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    margin-left: 10px;
}

/* Meu Perfil */
.detail-item .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* FormulÃ¡rio de usuÃ¡rio */
.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* BotÃ£o primÃ¡rio */
.btn-primary {
    background: linear-gradient(135deg, #1a5f2a, #0e3d1a);
    color: white;
    border-radius: 8px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,95,42,0.3);
}

/* ===== MEU PERFIL - FORMULÁRIO MELHORADO ===== */
.profile-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.profile-form-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #1a5f2a 0%, #0e3d1a 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.form-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-header p {
    font-size: 14px;
    opacity: 0.9;
}

.profile-form {
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section:not(:last-child) {
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a5f2a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

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

.form-group label {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #1a5f2a;
    font-size: 14px;
}

.input-modern {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-modern:focus {
    outline: none;
    border-color: #1a5f2a;
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.input-modern::placeholder {
    color: #ccc;
}

.input-disabled {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.level-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge-form {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.security-info {
    background: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0066cc;
    font-size: 14px;
}

.security-info i {
    font-size: 16px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.btn-save-profile {
    flex: 1;
    padding: 14px 30px;
    background: linear-gradient(135deg, #1a5f2a 0%, #0e3d1a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-save-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 95, 42, 0.3);
}

.btn-save-profile:active {
    transform: translateY(0);
}

.btn-cancel-profile {
    flex: 1;
    padding: 14px 30px;
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-cancel-profile:hover {
    background: #e0e0e0;
    border-color: #999;
}

/* Responsivo */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .profile-form {
        padding: 20px;
    }

    .form-header {
        padding: 20px;
    }

    .form-header h2 {
        font-size: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
    }
}
