/* Variaveis e Design System */
:root {
    --primary-color: #1a252f;
    --accent-color: #d35400;
    /* Laranja queimado para 'Casebre' */
    --hover-color: #e67e22;
    --bg-color: #f0f2f5;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f1c40f;
    --sidebar-width: 260px;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Layout Principal */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Moderna */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 30px 20px;
    background-color: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0 0 5px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--white);
}

.role-badge {
    display: inline-block;
    background-color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 16px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.nav-links li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-left-color: var(--accent-color);
}

.nav-links li.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links li.logout a {
    color: #e74c3c;
}

.nav-links li.logout a:hover {
    background-color: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
}

/* Conteúdo Principal */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    background-color: var(--white);
    padding: 20px 40px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Cards e Paineis */
.welcome-card,
.form-card,
.card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.welcome-card h3,
.form-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    /* Reduced from 25px */
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 8px;
    /* Slightly tighter radius */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-info h3 {
    margin: 0;
    font-size: 0.75rem;
    /* Reduced from 0.9rem */
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info .number {
    font-size: 1.8rem;
    /* Reduced from 2.5rem */
    font-weight: 700;
    color: var(--primary-color);
    margin: 5px 0 0 0;
}

.card-icon {
    font-size: 2rem;
    /* Reduced from 2.5rem */
    opacity: 0.2;
    color: var(--primary-color);
}

/* Formulários Modernos */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    display: block;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

button.btn-save {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
    width: auto;
    min-width: 200px;
    display: block;
    margin-top: 20px;
}

button.btn-save:hover {
    background-color: #219150;
}

/* Tabelas Bonitas */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background-color: #fafafa;
}

/* Utilitários e Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.success {
    background-color: #e8f5e9;
    color: #27ae60;
}

.status-badge.warning {
    background-color: #fef9e7;
    color: #f1c40f;
}

.status-badge.danger {
    background-color: #fce8e6;
    color: #e74c3c;
}

.action-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: transform 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.delete {
    color: var(--danger);
}

.action-btn.edit {
    color: var(--primary-color);
}

/* Upload Customizado */
.image-upload-area {
    width: 100%;
    height: 180px;
    border: 2px dashed #bdc3c7;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: var(--accent-color);
    background: #fff;
}

.image-upload-label {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    /* Deixa clique passar para input */
}

.image-upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    left: 0;
    top: 0;
}