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

body { background-color: #f4f7f6; color: #333; display: flex; height: 100vh; }

.sidebar { width: 250px; background-color: #1a252f; color: #fff; display: flex; flex-direction: column; }
.brand { padding: 30px 20px; background-color: #151e27; }
.brand h2 { font-weight: 700; font-size: 24px; letter-spacing: 1px; }
.brand p { font-size: 12px; color: #1abc9c; margin-top: 5px; }

.nav { list-style: none; margin-top: 20px; }
.nav li { padding: 15px 20px; cursor: pointer; font-size: 15px; font-weight: 500; transition: all 0.2s ease; border-left: 4px solid transparent; }
.nav li:hover { background-color: #2c3e50; }
.nav li.active { background-color: #2c3e50; border-left: 4px solid #1abc9c; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
header { background-color: #fff; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
h1 { font-size: 22px; color: #2c3e50; }

.date-selector { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.date-selector input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; }

.view { display: none; padding: 40px; }
.view.active { display: block; }

.card { background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.04); }
.card h3 { margin-bottom: 20px; color: #2c3e50; font-size: 18px; border-bottom: 2px solid #f4f7f6; padding-bottom: 10px; }

table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #f9fbfb; font-weight: 600; color: #555; }

input[type="number"], input[type="text"], input[type="date"], select { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; outline: none; transition: border-color 0.2s; }
input:focus, select:focus { border-color: #1abc9c; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #444; font-size: 14px;}

.task-row { display: flex; gap: 15px; margin-bottom: 15px; align-items: center; background: #fcfcfc; padding: 15px; border-radius: 6px; border: 1px solid #eee; }
.task-row .flex-2 { flex: 2; }
.task-row .flex-1 { flex: 1; }
.remove-btn { background: #e74c3c; color: white; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-weight: bold; }

.actions { margin-top: 30px; text-align: right; }

.btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: 500; font-size: 14px; transition: background 0.2s; }
.btn-primary { background-color: #1abc9c; color: #fff; }
.btn-primary:hover { background-color: #16a085; }
.btn-secondary { background-color: #ecf0f1; color: #2c3e50; }
.btn-secondary:hover { background-color: #bdc3c7; }

.master-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.crud-form { margin-top: 20px; background: #f9fbfb; padding: 20px; border-radius: 8px; border: 1px solid #eee; display:none;}
.crud-form h4 { margin-bottom: 15px; color:#2c3e50;}

.toast { position: fixed; bottom: -60px; right: 40px; background: #27ae60; color: white; padding: 15px 30px; border-radius: 4px; font-weight: 500; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: bottom 0.3s ease; z-index: 1000; }
.toast.show { bottom: 40px; }
.toast.error { background: #e74c3c; }

/* Print Envelope Overrides */
@media print {
    .sidebar, header, .date-selector, .print-actions, .toast { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 !important; }
    
    /* Hide the form inputs at the top of Reports View */
    #reports-view > .card:first-child { display: none !important; }
    #reports-view > .card:nth-child(2) > h3 { display: none !important; }
    #reports-view > .card:nth-child(2) > div:nth-child(2) { display: none !important; }
    
    .print-envelope { 
        page-break-inside: avoid;
        break-inside: avoid;
        page-break-after: always;
        break-after: page; 
        box-shadow: none !important; 
        margin: 0 auto !important; 
        border: 1px solid #000 !important; 
    }
}
