:root {
    --primary: #4f8cff;
    --primary-dark: #204e90;
    --secondary: #0cc6e8;
    --accent: #ff637d;
    --success: #0fd46b;
    --warning: #ffc34a;
    --danger: #ff3f51;
    --info: #22e1ff;
    --bg: #f4f6fb;
    --card: #fff;
    --sidebar: #111928;
    --sidebar-active: #263143;
    --text: #232e38;
    --text-light: #728197;
    --shadow: 0 8px 32px rgba(30,50,90,0.07);

    --radius: 14px;
    --radius-sm: 7px;
    --transition: all 0.22s cubic-bezier(.8,.15,.39,1.08);

    --sidebar-width: 255px;
}

/* ===== RESET & BASE ===== */
*, *:before, *:after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', 'Inter', Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    margin: 0 0 12px 0;
    color: var(--text);
}

/* ===== DASHBOARD LAYOUT ===== */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar);
    color: #fff;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 90;
    box-shadow: 2px 0 20px rgba(16,18,23,0.05);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.main-content {
    flex: 1 1 0;
    margin-left: var(--sidebar-width);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
}
@media (max-width: 992px) {
    .sidebar {
        left: -100%;
        position: fixed;
        z-index: 111;
        transition: var(--transition);
    }
    .sidebar.active {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
    }
}
@media (max-width: 768px) {
    .content-wrapper, .top-nav, .main-footer {
        padding-left: 10px;
        padding-right: 10px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }
    .card-header,
    .card-body {
        padding-left: 12px;
        padding-right: 12px;
    }
    .table th, .table td {
        padding: 8px 7px;
        font-size: 13px;
    }
}

/* ===== SIDEBAR ===== */
.sidebar-header {
    padding: 34px 0 18px 0;
    text-align: center;
    border-bottom: 1px solid #232d40;
}
.sidebar-header .logo {
    width: 52px;
    margin-bottom: 8px;
}
.sidebar-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.1px;
}
.sidebar-nav {
    flex: 1;
    margin-top: 16px;
}
.sidebar-nav ul {
    padding: 0;
    margin: 0;
    list-style: none;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav li a {
    color: #fff;
    opacity: 0.86;
    display: flex;
    align-items: center;
    padding: 15px 28px;
    font-size: 15px;
    border-left: 4px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}
.sidebar-nav li a i {
    font-size: 18px;
    margin-right: 12px;
}
.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: var(--sidebar-active);
    color: var(--primary);
    border-left: 4px solid var(--primary);
    opacity: 1;
}
.sidebar-nav .nav-section {
    padding: 20px 28px 7px;
    font-size: 12px;
    font-weight: 700;
    color: #6f7790;
    letter-spacing: 0.5px;
    opacity: 0.65;
}
.sidebar-footer {
    margin-top: auto;
    padding: 18px 24px;
    border-top: 1px solid #232d40;
    font-size: 13px;
    color: #a7b3d6;
    background: rgba(24,28,44,0.10);
}

/* ===== TOP NAV ===== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: #fff;
    box-shadow: 0 2px 16px rgba(16,18,23,0.04);
    position: sticky;
    top: 0;
    z-index: 2;
}
.top-nav h1 {
    font-size: 21px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-light);
    margin-right: 14px;
    cursor: pointer;
    display: none;
}
.user-dropdown {
    position: relative;
}
.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 13px;
    border-radius: 20px;
    background: rgba(24, 28, 44, 0.07);
    gap: 9px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.user-info span {
    font-size: 15px;
    color: var(--primary-dark);
    font-weight: 600;
}
.user-info i {
    font-size: 13px;
    color: var(--primary-dark);
}
.dropdown-menu {
    position: absolute;
    right: 0; top: 130%;
    min-width: 190px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 10px 32px rgba(40,60,120,0.13);
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition);
    z-index: 10;
}
.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu a {
    color: var(--text);
    font-weight: 500;
    padding: 10px 22px;
    display: block;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.dropdown-menu a:hover {
    background: var(--bg);
    border-left: 3px solid var(--primary);
    color: var(--primary);
}
.dropdown-menu a i {
    margin-right: 8px;
    font-size: 14px;
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    padding: 35px 32px;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===== DASHBOARD CARDS/GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

.summary-cards-container {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}

.summary-card {
    display: flex;
    align-items: center;
    padding: 24px 25px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
    gap: 17px;
    transition: var(--transition);
    min-height: 110px;
    position: relative;
    overflow: hidden;
}
.summary-card.bg-primary { background: var(--primary); }
.summary-card.bg-success { background: var(--success); }
.summary-card.bg-warning { background: var(--warning); }
.summary-card.bg-danger { background: var(--danger); }

.summary-card .card-icon {
    font-size: 35px;
    opacity: 0.15;
    position: absolute;
    right: 15px; bottom: 8px;
    z-index: 0;
}
.summary-card .card-info {
    z-index: 1;
    position: relative;
}
.summary-card .card-info h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #fff;
}
.summary-card .card-info p {
    font-size: 14px;
    margin: 0;
    opacity: 0.87;
}

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: none;
    margin-bottom: 26px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 26px 11px 26px;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 16px;
}
.card-body {
    padding: 19px 26px;
}

.chart-card {
    grid-column: 1 / -1;
    margin-top: 20px;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    background: none;
    margin: 0;
}
.table th, .table td {
    padding: 14px 14px;
    text-align: left;
    font-size: 15px;
}
.table th {
    background: #f2f5fa;
    color: var(--text-light);
    font-weight: 700;
    border-bottom: 2.5px solid #eaeaea;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.4px;
}
.table td {
    border-bottom: 1.5px solid #edf2f7;
}
.table-hover tbody tr:hover td {
    background: #f0f8ff;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--secondary);
    letter-spacing: 0.5px;
}
.bg-primary { background: var(--primary) !important;}
.bg-success { background: var(--success) !important;}
.bg-warning { background: var(--warning) !important;}
.bg-danger  { background: var(--danger) !important;}
.bg-secondary { background: var(--sidebar-active) !important; }

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.action-buttons a,
.action-buttons button,
.action-buttons .btn {
    margin: 0 !important;
}
.action-buttons form {
    display: inline-block;
    margin: 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(79,140,255,0.06);
    height: 34px;
    min-width: 34px;
    margin-bottom: 1%;
}
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,140,255,0.15);
    color: #fff;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    height: 30px;
    min-width: 30px;
}
.btn-outline {
    background: #fff;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
.btn-danger {
    background: var(--danger);
}
.btn-danger:hover {
    background: #c92036;
}
.btn-warning {
    background: var(--warning);
    color: #fff;
}
.btn-warning:hover {
    background: #ffb600;
}
.btn-info {
    background: var(--info);
    color: #fff;
}
.btn-info:hover {
    background: #04b8d5;
}

/* ===== FORMS ===== */
.form-label {
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
    display: block;
    font-size: 15px;
}
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 400;
    background: #f7f9fc;
    color: var(--text);
    border: 1.5px solid #e6e8ee;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}
.form-control:focus,
.form-select:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,140,255,0.09);
}
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}
.invalid-feedback {
    display: none;
    color: var(--danger);
    font-size: 13px;
    margin-top: 5px;
}
.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ===== LIST GROUP ===== */
.list-group-item {
    padding: 13px 22px;
    border-color: #f0f2f7;
    font-size: 15px;
    color: var(--text);
}
.list-group-item strong {
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 120px;
    display: inline-block;
}

/* ===== FOOTER ===== */
.main-footer {
    padding: 14px 32px;
    background: #fff;
    border-top: 1.5px solid #ecf1f7;
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* ===== ALERTS ===== */
.alert {
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-danger {
    color: #fff;
    background: var(--danger);
    border-color: #ffadba;
}
.alert-success {
    color: #fff;
    background: var(--success);
    border-color: #c7f2dd;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(120deg, var(--primary) 20%, var(--secondary) 100%);
    padding: 40px 0;
}
.login-container {
    max-width: 400px;
    width: 100%;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 38px 32px 30px 32px;
    animation: fadeIn 0.7s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: translateY(0);}
}
.login-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-header .logo {
    width: 74px;
    margin-bottom: 16px;
}
.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}
.login-header p {
    color: var(--text-light);
    font-size: 14px;
}
.login-form .form-group { margin-bottom: 18px; }
.login-form label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 5px;
    display: block;
    font-size: 15px;
}
.login-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid #e6e8ee;
    background: #f7f9fc;
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}
.login-form input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(79,140,255,0.09);
}

/* Responsividade adicional */
@media (max-width: 1200px) {
    .summary-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-cards-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Estilo para os botões de ação */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Remove margens dos forms dentro dos containers de ação */
.action-buttons form {
    margin: 0;
}

/* Tamanho consistente para os botões */
.btn-sm.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ===== PÁGINAS DE VISUALIZAÇÃO (SHOW/VIEW) ===== */
.view-container {
    padding: 25px 0;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.view-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: none;
}

.view-card-header {
    padding: 18px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--primary-dark);
    background: rgba(79, 140, 255, 0.05);
}

.view-card-header i {
    font-size: 18px;
    color: var(--primary);
}

.view-card-body {
    padding: 25px;
}

.view-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.view-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(79, 140, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
}

.view-profile-info h3 {
    margin-bottom: 5px;
    color: var(--text);
    font-weight: 600;
}

.view-detail-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.view-detail-row:last-child {
    border-bottom: none;
}

.view-detail-label {
    min-width: 180px;
    font-weight: 500;
    color: var(--text-light);
}

.view-detail-value {
    flex: 1;
    color: var(--text);
}

.view-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

/* Responsividade */
@media (max-width: 768px) {
    .view-detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .view-detail-label {
        min-width: 100%;
    }
    
    .view-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}