/* Mosta Panel - Minimalist, High-Precision POS Styles */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --warning: #d97706;
  --bg-main: #f4f5f8;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-arabic: 'Cairo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: var(--font-mono);
  direction: ltr;
  display: inline-block;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Modern Card */
.card {
  background: var(--card-bg);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s;
}

/* Responsive Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 0.875rem;
  border: 1px solid var(--border-color);
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  -webkit-overflow-scrolling: touch;
}

.table-responsive table, table.mosta-table, table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.875rem;
  table-layout: auto;
}

thead th {
  background-color: #0f172a !important;
  color: #ffffff !important;
  padding: 0.9rem 1.1rem !important;
  font-weight: 700;
  font-size: 0.825rem;
  letter-spacing: 0.025em;
  text-align: center !important;
  vertical-align: middle !important;
  border-bottom: 2px solid #1e293b;
  white-space: nowrap;
}

tbody td {
  padding: 0.9rem 1.1rem !important;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle !important;
  text-align: center !important;
  color: #1e293b;
}

/* Explicit alignment helpers */
thead th.text-center, tbody td.text-center, th.text-center, td.text-center {
  text-align: center !important;
}

thead th.text-left, tbody td.text-left, th.text-left, td.text-left {
  text-align: left !important;
}

thead th.text-right, tbody td.text-right, th.text-right, td.text-right {
  text-align: right !important;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-arabic);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover {
  background-color: #047857;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  text-align: right;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .card {
    padding: 1rem;
    border-radius: 0.75rem;
  }
  .btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }
  thead th, tbody td {
    padding: 0.75rem 0.75rem;
  }
}



/* ============================================================== */
/* تحسينات العرض المتجاوب على الجوال (Mobile Responsiveness)      */
/* ============================================================== */
@media (max-width: 768px) {
    /* 1. ضبط الحاوية لتصل للحواف مع هامش مجهري وتتوسط الشاشة */
    body, html {
        overflow-x: hidden;
    }

    .container, main {
        padding-left: 0.25rem !important; /* هامش بسيط جدا جدا */
        padding-right: 0.25rem !important;
        margin-left: auto !important; /* توسط اجباري */
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. تقليص الحواف الداخلية للبطاقات */
    .card {
        border-radius: 0.5rem !important;
        padding: 0.5rem !important; /* تقليل الفراغ الداخلي للبطاقة */
        margin-bottom: 0.75rem !important;
    }

    /* 3. تصغير أقصى لحجم الخلايا والحواف الداخلية في الجداول */
    .table-responsive table th {
        font-size: 0.65rem !important;
        padding: 0.4rem 0.2rem !important;
        white-space: nowrap !important;
    }

    .table-responsive table td {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.2rem !important;
        white-space: nowrap !important;
    }

    .btn {
        font-size: 0.7rem !important;
        padding: 0.35rem 0.6rem !important;
    }

    .font-mono {
        font-size: 0.9em !important;
    }

    h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
}

