/* =========================================================
   🛠️ WORKSHOP SYSTEM — FULL STYLESHEET
   Mobile-first · Amharic-friendly · Beautiful Login
   ========================================================= */

/* ============ RESET ============ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html { font-size: 18px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans Ethiopic", "Nyala", Arial, sans-serif;
  margin: 0;
  background: #f4f1ea;
  color: #2b2b2b;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

/* =========================================================
   ✨ LOGIN PAGE — AMAZING STYLE ✨
   ========================================================= */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(210,166,121,.35), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139,90,43,.5), transparent 50%),
    linear-gradient(135deg, #4a2f17 0%, #6b4423 45%, #8b5a2b 100%);
  position: relative;
  overflow: hidden;
}

/* የሚንቀሳቀሱ የእንጨት ክብ ቅርጾች */
.login-body::before,
.login-body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}
.login-body::before {
  width: 400px;
  height: 400px;
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}
.login-body::after {
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -200px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -30px) scale(1.1); }
}

/* የሎጊን ሳጥን */
.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 32px 26px 28px;
  box-shadow:
    0 20px 60px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,255,255,.05) inset;
  animation: slideUp .55s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}

/* የላይኛው ቀለም ሪባን */
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, #6b4423, #d2a679, #8b5a2b, #d2a679, #6b4423);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* የቋንቋ ቁልፎች (በሎጊን ሳጥን ውስጥ) */
.login-lang {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 14px;
}
.login-lang a {
  padding: 7px 12px;
  border-radius: 10px;
  background: #f0e8db;
  color: #6b4423;
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  transition: all .2s ease;
  border: 2px solid transparent;
}
.login-lang a:hover {
  background: #e3d6bf;
  transform: translateY(-1px);
}
.login-lang a.active {
  background: #6b4423;
  color: #fff;
  border-color: #d2a679;
  box-shadow: 0 4px 12px rgba(107,68,35,.3);
}

/* ርዕስ */
.login-title {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  color: #4a2f17;
  margin: 0 0 6px;
  letter-spacing: -.3px;
  line-height: 1.3;
}

.login-sub {
  text-align: center;
  color: #8a7d6b;
  font-size: .95rem;
  margin: 0 0 24px;
  font-weight: 500;
}

/* መለያ ጽሑፍ */
.login-label {
  display: block;
  margin-bottom: 6px;
  margin-top: 4px;
  font-size: .9rem;
  font-weight: 700;
  color: #6b4423;
  letter-spacing: .2px;
}

/* የሎጊን ግቤቶች */
.login-box input {
  width: 100%;
  padding: 15px 14px;
  border: 1.5px solid #dfd5c4;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fdfbf7;
  color: #2b2b2b;
  margin-bottom: 16px;
  transition: all .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.login-box input::placeholder {
  color: #b8ae9e;
}
.login-box input:focus {
  outline: none;
  border-color: #8b5a2b;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139,90,43,.14);
  transform: translateY(-1px);
}

/* የሎጊን ቁልፍ */
.login-btn {
  width: 100% !important;
  padding: 16px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: .5px;
  border-radius: 12px !important;
  margin-top: 8px !important;
  min-height: 54px !important;
  background: linear-gradient(135deg, #8b5a2b, #6b4423) !important;
  box-shadow: 0 6px 18px rgba(107,68,35,.32) !important;
  transition: all .2s ease !important;
}
.login-btn:hover {
  background: linear-gradient(135deg, #a06a35, #7d4f28) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(107,68,35,.42) !important;
}
.login-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 4px 12px rgba(107,68,35,.3) !important;
}

/* የስህተት መልዕክት (በሎጊን ገጽ) */
.login-box .msg {
  margin-bottom: 16px;
  text-align: center;
  animation: shake .4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* የሎጊን ገጽ በስልክ */
@media (max-width: 420px) {
  .login-box {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }
  .login-title { font-size: 1.2rem; }
  .login-sub   { font-size: .9rem; margin-bottom: 20px; }
  .login-box input { padding: 14px 12px; margin-bottom: 14px; }
  .login-btn   { min-height: 50px !important; font-size: 1rem !important; }
}

/* =========================================================
   HEADER (dashboard እና ሌሎች ገጾች)
   ========================================================= */
header {
  background: linear-gradient(135deg, #6b4423, #8b5a2b);
  color: #fff;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.header-left h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 700;
}
.user-greeting {
  font-size: .85rem;
  opacity: .95;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* የቋንቋ ቀያሪ (በራስጌ) */
.lang-switch {
  display: flex;
  gap: 4px;
}
.lang-switch a {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  border: 2px solid transparent;
  transition: all .15s ease;
}
.lang-switch a:hover { background: rgba(255,255,255,.28); }
.lang-switch a.active {
  background: #fff;
  color: #6b4423;
  border-color: #d2a679;
}

/* የውጣ ቁልፍ */
.logout-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: #dc3545;
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  min-height: 36px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .15s ease, transform .1s ease;
}
.logout-btn:hover  { background: #a71d2a; }
.logout-btn:active { transform: scale(.97); }

/* =========================================================
   NAVIGATION
   ========================================================= */
nav {
  background: #8b5a2b;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 19;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
nav::-webkit-scrollbar { display: none; }
nav a {
  color: #fff;
  padding: 14px 18px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
  border-bottom: 3px solid transparent;
  transition: background .15s ease;
}
nav a:hover { background: #a06a35; }
nav a.active {
  background: #d2a679;
  color: #3a2410;
  border-bottom-color: #6b4423;
}

/* =========================================================
   MAIN
   ========================================================= */
main {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 12px;
  color: #6b4423;
  font-size: 1.15rem;
  font-weight: 700;
}

/* =========================================================
   FORM ROWS
   ========================================================= */
.row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.row > * {
  width: 100%;
  min-width: 0;
}

/* =========================================================
   INPUTS
   ========================================================= */
input, select, textarea {
  padding: 14px 12px;
  border: 1.5px solid #cfc6b8;
  border-radius: 8px;
  width: 100%;
  font-size: 1rem;
  background: #fff;
  color: #2b2b2b;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #8b5a2b;
  box-shadow: 0 0 0 3px rgba(139,90,43,.15);
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b4423' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
button.btn, a.btn {
  display: inline-block;
  background: #6b4423;
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  min-height: 48px;
  transition: transform .05s ease, background .15s ease;
}
button.btn:active, a.btn:active { transform: scale(.98); }
button.btn:hover, a.btn:hover   { background: #4e3018; }
button.btn.danger, a.btn.danger { background: #b33; }
button.btn.danger:hover         { background: #8a1f1f; }
button.btn.secondary, a.btn.secondary { background: #888; }
button.btn.secondary:hover      { background: #666; }

@media (max-width: 640px) {
  button.btn, a.btn { width: 100%; }
  .return-form button.btn { width: auto; }
  .logout-btn, .lang-switch a { width: auto; }
}

/* =========================================================
   TABLES
   ========================================================= */
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 1rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
th { background: #efe8db; color: #6b4423; font-weight: 700; font-size: .95rem; }
tr:hover { background: #faf7f1; }
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.table-scroll table { margin-top: 0; }

/* =========================================================
   TAGS
   ========================================================= */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  white-space: nowrap;
}
.tag.paid, .tag.cash     { background: #28a745; }
.tag.credit, .tag.unpaid { background: #dc3545; }
.tag.partial             { background: #ff9800; }
.tag.wood  { background: #d4a373; }
.tag.metal { background: #6c757d; }
.tag.panel { background: #4a7c9e; }
.tag.other { background: #9b5de5; }

/* =========================================================
   SUMMARY BOXES
   ========================================================= */
.summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.summary .box {
  background: #fff;
  padding: 14px 16px;
  border-left: 5px solid #8b5a2b;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.summary .box h3 {
  margin: 0 0 4px;
  font-size: .85rem;
  color: #777;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.summary .box p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #6b4423;
  line-height: 1.2;
  word-break: break-all;
}

/* =========================================================
   BANNER (dashboard top)
   ========================================================= */
.banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.half {
  padding: 18px 14px;
  border-radius: 12px;
  color: #fff;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.half.in     { background: linear-gradient(135deg,#28a745,#1e7e34); }
.half.out    { background: linear-gradient(135deg,#dc3545,#a71d2a); }
.half.credit { background: linear-gradient(135deg,#ff9800,#e65100); }
.half .lbl {
  font-size: .8rem;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: .95;
  text-transform: uppercase;
}
.half .amt {
  font-size: 1.7rem;
  font-weight: 900;
  margin: 6px 0 4px;
  line-height: 1.1;
  word-break: break-all;
}
.half .sub { font-size: .75rem; opacity: .9; font-weight: 600; }

@media (max-width: 380px) {
  .banner { grid-template-columns: 1fr; }
}

/* =========================================================
   MESSAGES
   ========================================================= */
.msg {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
}
.msg.ok  { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.msg.err { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }

/* =========================================================
   DEBT ROWS (who owes money)
   ========================================================= */
.debt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.debt-row:last-child { border-bottom: none; }
.debt-info { flex: 1 1 auto; min-width: 0; }
.debt-name { font-size: 1.1rem; font-weight: 700; color: #2b2b2b; line-height: 1.3; }
.debt-phone { font-size: .85rem; color: #777; margin-top: 2px; }
.debt-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.debt-amount { font-size: 1.4rem; font-weight: 900; color: #dc3545; white-space: nowrap; }

/* =========================================================
   RENT ITEM (panel rent)
   ========================================================= */
.rent-item {
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.rent-item:last-child { border-bottom: none; }
.return-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.return-form input { flex: 1 1 120px; }

/* =========================================================
   CALL BUTTON
   ========================================================= */
.call-btn {
  display: inline-block;
  background: #1e88e5;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 36px;
  line-height: 1.4;
  white-space: nowrap;
  width: auto;
  transition: background .15s ease;
}
.call-btn:hover { background: #1565c0; }

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty {
  text-align: center;
  padding: 24px 12px;
  color: #28a745;
  font-weight: 700;
  font-size: 1.05rem;
  background: #eafaf0;
  border-radius: 10px;
}

/* =========================================================
   TABLET (min-width: 640px)
   ========================================================= */
@media (min-width: 640px) {
  html { font-size: 17px; }
  header h1 { font-size: 1.4rem; }
  .header-left h1 { font-size: 1.4rem; }

  .row { flex-direction: row; flex-wrap: wrap; }
  .row > * { flex: 1 1 160px; }

  .summary { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  main  { padding: 22px; }
  .card { padding: 20px; }

  .half .amt { font-size: 2.1rem; }
  .half { padding: 24px 18px; }

  .debt-right { flex-direction: row; align-items: center; gap: 14px; }

  .rent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
  }
  .rent-item .debt-info { flex: 1; }
  .return-form { margin-top: 0; flex: 0 0 auto; width: auto; }
  .return-form input { width: 140px; }
}

/* =========================================================
   DESKTOP (min-width: 960px)
   ========================================================= */
@media (min-width: 960px) {
  .summary { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  header { padding: 18px 30px; }
  header h1 { font-size: 1.5rem; }
  .header-left h1 { font-size: 1.5rem; }
  nav a { padding: 14px 22px; }
  main { padding: 26px; }
  .summary .box p { font-size: 1.7rem; }
}

/* =========================================================
   SMALL SCREEN (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {
  .header-left h1 { font-size: 1rem; }
  .user-greeting  { font-size: .75rem; }
  .logout-btn     { padding: 7px 12px; font-size: .8rem; }
  .lang-switch a  { padding: 6px 8px; font-size: .75rem; }
}