@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Cairo:wght@400;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  --primary:#1a1a2e;
  --primary-dark:#0f0f1a;
  --gold:#d4af37;
  --gold-light:#f0d878;
  --gold-dark:#a8842a;
  --bg:#f5f1e8;
  --card:#ffffff;
  --text:#1e1e2f;
  --muted:#6b6b80;
  --success:#1f8a5f;
  --danger:#c0392b;
  --pending:#8a8fa3;
  --preparing:#d9822b;
  --ready:#1f8a5f;
  --delivered:#2d6fd9;
  --shadow: 0 10px 30px rgba(15,15,26,0.12);
  --shadow-soft: 0 4px 14px rgba(15,15,26,0.08);
  --radius: 16px;
  --font-ar: 'Cairo', Tahoma, Arial, sans-serif;
  --font-en: 'Playfair Display', 'Cairo', Georgia, serif;
}

html, body { height: 100%; }

body{
  font-family: var(--font-ar);
  background:
    radial-gradient(circle at 15% 10%, rgba(212,175,55,0.10), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(212,175,55,0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-en); font-weight: 700; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--font-ar); font-weight: 800; }

img { max-width: 100%; display: block; }

.logo-circle{
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 0 7px rgba(212,175,55,0.18),
    0 10px 26px rgba(0,0,0,0.25);
  overflow: hidden;
  flex-shrink: 0;
}
.logo-circle img{
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.logo-circle.sm{
  width: 78px;
  height: 78px;
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 0 5px rgba(212,175,55,0.15),
    0 6px 16px rgba(0,0,0,0.25);
}

.login-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 55%, #23233d 100%);
}

.login-box{
  background: #ffffff;
  padding: 44px 36px 36px;
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 380px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-box::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
}

.login-box h2{
  font-size: 26px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.login-box .subtitle{
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 20px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: var(--font-ar);
}

.tabs{
  display: flex;
  margin-bottom: 20px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid #e6e0d2;
}
.tabs button{
  flex: 1;
  padding: 10px;
  border: none;
  background: #f5f1e8;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-ar);
  transition: background .2s ease, color .2s ease;
}
.tabs button.active{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--gold-light);
}

.login-box form{ display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.login-box input{
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #e6e0d2;
  border-radius: 12px;
  font-size: 15px;
  background: #fbfaf7;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.login-box input:focus{
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
  background: #fff;
}

.login-box button[type="submit"]{
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--gold-light);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 6px;
  font-family: var(--font-ar);
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 20px rgba(15,15,26,0.3);
}
.login-box button[type="submit"]:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,15,26,0.4);
}

.form-msg{
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 600;
}
.form-msg.error{ background: #fdecea; color: var(--danger); }

.layout{ display: flex; min-height: 100vh; }

.sidebar{
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar .brand{
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  text-align: center;
}
.sidebar .brand strong{
  color: var(--gold-light);
  font-family: var(--font-ar);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.sidebar nav{ display: flex; flex-direction: column; gap: 6px; flex: 1; }

.sidebar a{
  display: block;
  color: #c9c9d8;
  padding: 12px 16px;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .2s ease, color .2s ease;
}
.sidebar a.active,
.sidebar a:hover{
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--primary-dark);
}

.sidebar .divider{
  height: 1px;
  background: rgba(212,175,55,0.2);
  margin: 12px 0;
}

.content{ flex: 1; padding: 32px; min-width: 0; }

.content h2{
  color: var(--primary-dark);
  font-size: 24px;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 12px;
  display: inline-block;
}
.content h2::after{
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 3px;
}

.cards{ display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }

.card{
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  flex: 1;
  min-width: 170px;
  text-align: center;
  border: 1px solid rgba(212,175,55,0.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover{ transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3{ font-size: 30px; color: var(--primary-dark); font-weight: 800; margin-bottom: 4px; }
.card p{ color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.5px; }

.table-wrap{ overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-soft); }

table{
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
th, td{
  padding: 14px 16px;
  border-bottom: 1px solid #f0ece0;
  font-size: 14.5px;
  text-align: start;
  white-space: nowrap;
}
th{
  background: linear-gradient(135deg, #f5f1e8, #ede6d4);
  color: var(--primary-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.6px;
}
tbody tr:hover td{ background: #faf8f2; }

.badge{
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.badge.Pending{ background: var(--pending); }
.badge.In-Preparation{ background: var(--preparing); }
.badge.Ready{ background: var(--ready); }
.badge.Delivered{ background: var(--delivered); }

.btn{
  padding: 9px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 10px rgba(15,15,26,0.2);
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15,15,26,0.3); }
.btn.danger{ background: linear-gradient(135deg, #d9483a, var(--danger)); }
.btn.success{ background: linear-gradient(135deg, #27a373, var(--success)); }

.new-flash{ animation: flash 1s ease-in-out 3; }
@keyframes flash{ 0%{ background:#fff4c2; } 100%{ background: transparent; } }

.item-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.item-card{
  background: var(--card);
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 14.5px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.item-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow); }
.item-card.selected{
  border-color: var(--gold);
  background: linear-gradient(135deg, #fdf6e3, #fbeec9);
  box-shadow: 0 6px 18px rgba(212,175,55,0.3);
}
.category-title{
  margin: 28px 0 14px;
  color: var(--primary-dark);
  font-size: 19px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 8px;
  display: inline-block;
}

.form-card{
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  max-width: 440px;
  margin-bottom: 24px;
}
.form-card label{
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-card input, .form-card select{
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e6e0d2;
  border-radius: 10px;
  font-size: 14.5px;
  margin-bottom: 14px;
  font-family: inherit;
  background: #fbfaf7;
}
.form-card input:focus, .form-card select:focus{
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
  background: #fff;
}

@media (max-width: 900px){
  .sidebar{ width: 200px; }
  .content{ padding: 24px; }
}

@media (max-width: 768px){
  .layout{ flex-direction: column; }
  .sidebar{
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px 16px;
    gap: 10px;
  }
  .sidebar .brand{
    display: none;
  }
  .sidebar nav{
    flex-direction: row;
    flex: none;
  }
  .sidebar a{
    white-space: nowrap;
    padding: 10px 14px;
  }
  .content{ padding: 18px; }
  .login-box{ padding: 32px 24px; }
  .cards{ flex-direction: column; }
  .card{ min-width: 100%; }
}