:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #0f766e;
  --primary-light: #ccfbf1;
  --primary-hover: #115e59;
  --accent-green: #10b981;
  --accent-green-bg: #ecfdf5;
  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.5; font-size: 14px; }

.site-header { background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; }
.nav-container { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg, #0f766e, #14b8a6); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 17px; }
.brand-title { font-size: 18px; font-weight: 800; color: var(--text-main); text-decoration: none; letter-spacing: -0.3px; }
.brand-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.brand-tag-free { background: #f1f5f9; color: var(--text-muted); }
.brand-tag-pro { background: #fef3c7; color: #b45309; }

.nav-links { display: flex; gap: 16px; list-style: none; align-items: center; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: color 0.15s; }
.nav-links a.active, .nav-links a:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-primary { background-color: var(--primary); color: white; border: none; padding: 7px 14px; font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); padding: 7px 12px; font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn-xs { background: #f1f5f9; border: 1px solid var(--border-color); padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-main); text-decoration: none; display: inline-block; }
.btn-xs-green { background: var(--accent-green-bg); border-color: #bbf7d0; color: #166534; }

.tariff-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.tariff-free { background: #f1f5f9; color: var(--text-muted); }
.tariff-pro { background: #fef3c7; color: #b45309; }

.user-pill { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-color); border-radius: 20px; background: var(--bg-card); font-size: 12px; font-weight: 600; text-decoration: none; color: var(--text-main); white-space: nowrap; }
.logout-link { font-size: 12px; color: #ef4444; text-decoration: none; margin-left: 2px; }

.main-wrapper { max-width: 1320px; margin: 20px auto 0; padding: 0 20px; min-height: calc(100vh - 160px); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 3px; }

.filter-btn { border: none; background: #e2e8f0; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 6px; text-decoration: none; display: inline-block; }
.filter-btn.active { background: white; color: var(--text-main); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.kpi-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.badge-green { background: var(--accent-green-bg); color: var(--accent-green); }
.badge-blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.kpi-value { font-size: 24px; font-weight: 800; color: var(--text-main); word-break: break-all; }
.kpi-foot { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.content-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 36px; }
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 15px; font-weight: 700; }

.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { background: #f8fafc; padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border-color); text-transform: uppercase; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.obj-type-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; background: #f1f5f9; color: #475569; padding: 2px 6px; border-radius: 4px; }
.status-pill { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.status-repair { background: var(--accent-amber-bg); color: var(--accent-amber); }
.status-sale { background: var(--accent-blue-bg); color: var(--accent-blue); }
.status-done { background: var(--accent-green-bg); color: var(--accent-green); }
.annual-yield { font-size: 15px; font-weight: 800; color: var(--primary); }

.right-stack { display: flex; flex-direction: column; gap: 20px; }
.calc-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 7px; font-size: 13px; outline: none; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }

.calc-result-box { background: #f8fafc; border: 1px dashed var(--border-color); border-radius: 8px; padding: 12px; }
.calc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.calc-row.highlight { font-weight: 700; font-size: 14px; color: var(--primary); border-top: 1px solid var(--border-color); padding-top: 6px; margin-top: 6px; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.5); z-index: 100; align-items: center; justify-content: center; padding: 12px; }
.modal-overlay.active { display: flex; }
.modal-box { background: #ffffff; width: 100%; max-width: 580px; max-height: 92vh; overflow-y: auto; border-radius: var(--radius); padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-size: 16px; font-weight: 700; }
.close-modal { cursor: pointer; font-size: 20px; border: none; background: transparent; color: var(--text-muted); line-height: 1; }

.site-footer { border-top: 1px solid var(--border-color); background: var(--bg-card); padding: 20px 16px; font-size: 12px; color: var(--text-muted); margin-top: 40px; }
.footer-container { max-width: 1320px; margin: 0 auto; }

.landing-wrapper { max-width: 1240px; margin: 0 auto; padding: 30px 16px 50px; }
.hero-section { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; margin-bottom: 48px; }
.hero-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--primary); background: var(--primary-light); padding: 4px 10px; border-radius: 6px; margin-bottom: 14px; }
.hero-title { font-size: 34px; font-weight: 800; line-height: 1.2; letter-spacing: -1px; margin-bottom: 14px; }
.hero-desc { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 18px; }
.feature-icon { font-size: 26px; margin-bottom: 8px; }
.feature-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.tariffs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 820px; margin: 0 auto; }
.tariff-card { border: 1px solid var(--border-color); border-radius: var(--radius); padding: 22px; background: #ffffff; }
.tariff-card-featured { border: 2px solid var(--primary); background: #fcfefe; position: relative; }
.tariff-featured-badge { position: absolute; top: -12px; right: 16px; background: var(--primary); color: white; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.tariff-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tariff-price { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.tariff-period { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.tariff-list { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 12px; margin-bottom: 18px; }

.btn-add-receipt {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: 7px !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  text-decoration: none !important;
}
.btn-add-receipt:hover { background: #047857 !important; }

.deal-sold-banner {
  background: #ecfdf5;
  border: 2px solid #10b981;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1024px) {
  .nav-container { padding: 10px 14px; }
  .nav-links { gap: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .content-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-container { flex-direction: column; align-items: stretch; gap: 10px; }
  .brand { justify-content: space-between; }
  .nav-links { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; gap: 12px; }
  .header-actions { justify-content: space-between; }
  .hero-section { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .tariffs-grid { grid-template-columns: 1fr; }
}
