/* ========== Reset e Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ========== Container Principal ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ========== Header ========== */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ========== Navegação ========== */
nav {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav a:hover {
    background: #667eea;
    color: white;
}

nav a.active {
    background: #667eea;
    color: white;
}

/* ========== Main Content ========== */
main {
    padding: 30px 20px;
}

/* ========== Ícones ========== */
.icon {
    margin-right: 8px;
    vertical-align: middle;
}

/* ========== Alertas ========== */
.alerts {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* ========== Botões ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9em;
}

.actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 0;
    min-width: 110px;
}

.actions form {
    display: inline-block;
    margin: 0 0 0 8px;
}

.actions .btn + .btn,
.actions .btn + form,
.actions form + .btn {
    margin-left: 8px;
}

.actions button.btn {
    line-height: 1;
}

/* ========== Formulários ========== */
form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

thead {
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 5px;
}

/* ========== Cards ========== */
.card {
    background: white;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-header h2 {
    color: #667eea;
    margin: 0;
}

.card-header h3 {
    color: #667eea;
    margin: 0;
}

.card-body {
    padding: 0;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
}

/* ========== Progress Bar ========== */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

/* ========== Badges ========== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

/* ========== Footer ========== */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

/* ========== Utility Classes ========== */
.page-heading {
    color: #667eea;
    margin-bottom: 20px;
}

.max-width-600 {
    max-width: 600px;
}

.card-margin-top {
    margin-top: 30px;
}

.card-margin-top-sm {
    margin-top: 20px;
}

.muted-small {
    color: #666;
}

.error-small {
    color: #c00;
}

.info-list {
    margin-left: 20px;
    line-height: 1.8;
}

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

.inline-form {
    display: inline;
    margin: 0;
}

.small-muted {
    font-size: 0.9em;
    color: #666;
}

.info-box {
    display: none;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 15px;
}

.no-margin {
    margin: 0;
    color: #333;
}

.label-cell {
    font-weight: 500;
}
