:root {
    --primary: #4c9855; /* Muzazco Green */
    --accent: #338dbc; /* Muzazco Blue */
    --bg-main: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --danger: #ef4444;
    
    font-family: 'Outfit', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { background: var(--bg-main); color: var(--text-main); min-height: 100vh; }

/* Ad Bar */
.top-ad-bar { width: 100%; background: #fff; border-bottom: 1px solid var(--card-border); padding: 0.5rem 0; min-height: 100px; display: flex; justify-content: center; }
.ad-placeholder { width: 728px; height: 90px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #94a3b8; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; border-radius: 4px; }

/* Page Structure */
.page-wrapper { display: flex; max-width: 1400px; margin: 0 auto; padding: 1rem; gap: 1.5rem; }
.main-content { flex: 1; max-width: 850px; margin: 0 auto; }
.side-ad { width: 160px; }
@media (max-width: 1100px) { .side-ad { display: none; } }
.ad-placeholder-vertical { width: 160px; height: 600px; background: #fff; border: 1px dashed #cbd5e1; position: sticky; top: 1rem; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; color: #94a3b8; font-size: 0.7rem; border-radius: 8px; }

/* Dashboard Tool Card */
.dashboard-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 2.5rem; box-shadow: 0 10px 15px -10px rgba(0,0,0,0.05); margin-bottom: 1.5rem; position: relative; }

.hero-header { text-align: center; margin-bottom: 1rem; }
.badge { background: #f0fdf4; color: var(--primary); padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 700; border: 1px solid #dcfce7; margin-bottom: 0.5rem; display: inline-block; }
.hero-header h1 { font-size: 2.25rem; font-weight: 850; background: linear-gradient(135deg, #000, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Invoice Inner Layout */
.invoice-container { padding: 0; min-height: 800px; color: #000; }

.invoice-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; }
.logo-box { width: 160px; height: 100px; }
.logo-placeholder { cursor: pointer; border: 2px dashed #e2e8f0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; height: 100%; transition: all 0.2s; background: #fafafa; }
.logo-placeholder:hover { border-color: var(--primary); color: var(--primary); }
.logo-placeholder span { font-size: 0.7rem; margin-top: 0.5rem; }
.logo-preview-img { max-width: 100%; max-height: 100%; object-fit: contain; }

.invoice-meta { text-align: right; }
.label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: #64748b; margin-bottom: 0.25rem; display: block; }
input[type=text], input[type=date], textarea, input[type=number] { border: none; font-family: inherit; font-size: 0.95rem; background: #fafafa; padding: 0.4rem; border-radius: 4px; width: 100%; }
input[type=text]:focus, textarea:focus { background: #fff; outline: 1px solid var(--primary); }
.h1-input { font-size: 2.5rem; font-weight: 850; text-align: right; background: transparent !important; padding: 0 !important; }

.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.addr-group textarea { height: 100px; resize: none; font-size: 1rem; line-height: 1.5; }

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; border-bottom: 2px solid #000; padding-bottom: 1.5rem; }

/* Table Style */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.items-table th { padding: 1rem 0.5rem; text-align: left; font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid #000; }
.items-table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid #f1f5f9; }
.items-table input { font-size: 1rem; background: #fff; }
.col-total { font-weight: 700; text-align: right; }
.col-qty, .col-rate { width: 100px; }
.col-qty input, .col-rate input { text-align: center; }

.add-row-btn { background: #f8fafc; border: 1px dashed var(--card-border); color: var(--primary); width: 100%; padding: 0.75rem; border-radius: 8px; font-weight: 700; cursor: pointer; margin-bottom: 2rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.add-row-btn:hover { background: #f0fdf4; border-color: var(--primary); }

/* Summary */
.summary-hub { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; margin-top: 1rem; }
.summary-meta textarea { height: 120px; resize: none; border: 1px solid #f1f5f9; background: #fff; }
.summary-totals { text-align: right; }
.sum-row { display: flex; justify-content: space-between; padding: 0.6rem 0; font-weight: 600; border-bottom: 1px solid #f1f5f9; }
.sum-row span:last-child { width: 100px; }
.grand-total { font-size: 1.5rem; font-weight: 850; border-bottom: 2px solid #000; margin-top: 0.5rem; padding: 1rem 0; color: #000; }

.mini-input { width: 60px !important; margin: 0 0.5rem; background: #fff !important; text-align: center; font-weight: 700; border: 1px solid #ddd !important; }

/* Action Buttons */
.action-bar { display: flex; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--card-border); }
.btn-main { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; padding: 1rem 1.5rem; border-radius: 8px; font-weight: 750; cursor: pointer; flex: 2; display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.btn-main.danger { background: #fff; border: 1px solid var(--danger); color: var(--danger); flex: 1; }
.btn-main:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.trash-row-btn { color: #ccc; cursor: pointer; transition: all 0.2s; border: none; background: none; }
.trash-row-btn:hover { color: var(--danger); }

/* SEO Article */
.seo-article { background: #fff; padding: 1.5rem; border-radius: 12px; border: 1px solid var(--card-border); margin-top: 2rem; }
.seo-article h2 { font-size: 1.5rem; margin-bottom: 0.85rem; }
.seo-article p { font-size: 0.95rem; line-height: 1.6; color: #4b5563; margin-bottom: 1.5rem; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.info-card { background: #f8fafc; padding: 1rem; border-radius: 10px; }
.info-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.info-card p { font-size: 0.85rem; color: #64748b; }

/* Print Overrides */
@media print {
    body { background: #fff !important; }
    .no-print { display: none !important; }
    .page-wrapper { display: block; padding: 0; margin: 0; max-width: 100%; }
    .main-content { max-width: 100%; margin: 0; }
    .dashboard-card { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
    .invoice-container { min-height: auto; }
    input, textarea { background: transparent !important; }
    input:focus, textarea:focus { outline: none !important; }
    .add-row-btn, .action-bar { display: none !important; }
    .items-table td { border-bottom: 1px solid #eee !important; }
    .logo-placeholder { border: none !important; background: transparent !important; }
    .logo-placeholder span, .logo-placeholder i { display: none !important; }
}

.hidden { display: none; }
.flex-center { display: flex; align-items: center; }
