:root {
    --primary: #1a5d3f;
    --primary-light: #2d8659;
    --success: #10b981;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--gray-50); color: var(--gray-900); line-height: 1.6; }

/* ===== HEADER ===== */
header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: var(--white); padding: 20px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
header h1 { font-size: 28px; margin-bottom: 5px; }
header p { font-size: 14px; opacity: 0.9; }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid var(--gray-200); flex-wrap: wrap; }
.tab-btn { padding: 12px 20px; background: transparent; border: none; border-bottom: 3px solid transparent; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--gray-600); transition: all 0.3s ease; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CARDS ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.card-label { font-size: 12px; color: var(--gray-600); text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }
.card-value { font-size: 24px; font-weight: 700; color: var(--gray-900); font-family: 'Courier New', monospace; }

/* ===== CHARTS ===== */
.chart-section { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 30px; }
.chart-section h3 { margin-bottom: 20px; color: var(--primary); font-size: 16px; }
.chart-wrapper { position: relative; height: 350px; }

/* ===== TABLE ===== */
.table-section { background: var(--white); padding: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 30px; overflow-x: auto; }
.table-section h3 { margin-bottom: 15px; color: var(--primary); font-size: 16px; }
table { width: 100%; border-collapse: collapse; }
thead { background-color: var(--gray-100); border-bottom: 2px solid var(--gray-200); }
th { padding: 12px; text-align: left; font-weight: 600; font-size: 12px; color: var(--gray-700); text-transform: uppercase; }
td { padding: 12px; border-bottom: 1px solid var(--gray-200); font-size: 14px; }
tbody tr:hover { background-color: var(--gray-50); }
.text-right { text-align: right; }
.text-green { color: var(--success); font-weight: 600; }
.text-red { color: var(--danger); font-weight: 600; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; text-align: left; }
label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--gray-700); }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--gray-300); border-radius: 6px; font-family: inherit; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 93, 63, 0.1); }

/* ===== BUTTONS ===== */
button { padding: 10px 16px; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; }
.btn-primary { background-color: var(--primary); color: var(--white); }
.btn-primary:hover { background-color: var(--primary-light); }
.btn-secondary { background-color: var(--gray-200); color: var(--gray-900); }
.btn-secondary:hover { background-color: var(--gray-300); }
.btn-danger { background-color: var(--danger); color: var(--white); }
.btn-danger:hover { background-color: #dc2626; }
.btn-success { background-color: var(--success); color: var(--white); }
.btn-success:hover { background-color: #059669; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

/* ===== SIGNATURE PAD ===== */
.signature-wrapper { border: 2px dashed var(--gray-300); border-radius: 6px; background-color: var(--gray-50); margin-bottom: 15px; overflow: hidden; }
#signaturePad { display: block; background: var(--white); cursor: crosshair; }
.signature-status { font-size: 13px; padding: 10px; margin-top: 10px; border-radius: 4px; background-color: #fef3c7; color: #92400e; }
.signature-status.confirmed { background-color: #d1fae5; color: #065f46; }

/* ===== LOGIN LAYOUT ===== */
.login-container { max-width: 400px; margin: 100px auto; padding: 30px; background: var(--white); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center; }
.login-container h2 { color: var(--primary); margin-bottom: 25px; }
.login-container .btn-primary { width: 100%; margin-top: 10px; padding: 12px; }
.error-message { color: var(--danger); font-size: 13px; margin-bottom: 15px; text-align: left; display: none; }

/* ===== PRINT STYLES ===== */
@media print {
    header, .tabs, .btn-group, button, input:not([type="hidden"]), select { display: none !important; }
    body { background: white; }
    .chart-section, .table-section { page-break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    .container { max-width: 100%; padding: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; }
    .chart-wrapper { height: 250px; }
    table { font-size: 12px; }
    th, td { padding: 8px; }
    .tabs { flex-direction: column; }
    .tab-btn { border-bottom: none; border-left: 3px solid transparent; padding-left: 15px; }
    .tab-btn.active { border-bottom-color: transparent; border-left-color: var(--primary); }
}