:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    background-image: radial-gradient(circle at top right, rgba(58, 123, 213, 0.15), transparent),
                      radial-gradient(circle at bottom left, rgba(0, 210, 255, 0.1), transparent);
}

/* Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
}

nav a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    background: rgba(0, 210, 255, 0.1);
}

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

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-value.profit { color: var(--accent-color); }
.stat-value.expense { color: var(--danger-color); }

/* Table Styles */
.table-container {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

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

/* Specific alignments */
.text-right { text-align: right; }
.positive { color: var(--accent-color); font-weight: 600; }
.negative { color: var(--danger-color); font-weight: 600; }

/* Micro-animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-card {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Status Badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
}

.status-pendente {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-nao-iniciado {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-iniciado {
    background: rgba(58, 123, 213, 0.15);
    color: #3a7bd5;
    border: 1px solid rgba(58, 123, 213, 0.3);
}

.status-portal {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.status-gerada {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-concluido {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

select.status-select {
    width: auto;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: var(--bg-dark);
}

/* Filter Cards */
.filter-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-card:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
}
.filter-card.active {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger-color);
}

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

.stat-card {
    display: flex;
    flex-direction: column;
    padding: 24px !important;
    text-align: center;
    transition: transform 0.3s ease;
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Print Styles */
@media print {
    nav, header, .stats-grid, #pedido-form, .glass-card h2, button, select {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .glass-card {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}
