/* ========== ROOT VARIABLES ========== */
:root {
  --primary-color: #003b73;
  --primary-dark: #002b5e;
  --secondary-color: #ebebf0;
  --accent-blue: #0078d7;
  --accent-green: #f1f507;
  --accent-yellow: #f39c12;
  --accent-red: #e74c3c;
  --text-color: #333;
  --border-radius: 12px;
  --transition: 0.3s ease;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --font: "Cairo", sans-serif;
}

/* ========== GLOBAL RESET ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--secondary-color);
  color: var(--text-color);
  direction: rtl;
}
main{
   height: calc(100vh -  150px);
  background-color: var(--gray-bg);
}
/* ========== HEADER & FOOTER ========== */
header,
footer {
  background-color: var(--primary-color);
  text-align: center;
  padding: 10px;
  background:var(--gray-bg);
   border-top:3px solid var(--primary-color); 

}
footer .div{
  margin-top:20px;
  color: var(--primary-color);
  font-weight: bold;
}


.cover_logo {
  width:55px;
  height: auto;
  border-radius: 50%;
  background-color: var(--text-color);
  box-shadow: 1px 10px 10px var(--primary-color);
}

.logo {
  width: 50px;
  height: auto;
  padding: auto;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

/* HEADER */
/* تعديل بسيط لضمان أن الهيدر ثابت ومظهر رسمي */
.topbar {
  background: var(--gray-bg);
  border-bottom: 3px solid var(--primary-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  color: var(--primary-color);
}

.user-info {
  text-align: right;
  font-size: 14px;
  color: var(--text-color);
}

.topnav a {
  margin-left: 12px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.topnav a:hover {
  color: var(--accent-blue);
}




/* ========== FORMS ========== */
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: border-color var(--transition);
}

a {
  color: white;
  text-decoration: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  outline: none;
}

button,
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

button:hover,
.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* for all */
.container{
  height: auto;
  width: 100%;

}

.center{
  display: flex;
  justify-content: center;
  align-items: center;
}

.p-t2{
  padding-top: 20px ;
}

.p-r2{
  padding-right: 20px ;
}

.border{
  border: var(--primary-color) 1px solid;
  border-radius: 10px;
  box-shadow: 10px 10px 10px var(--primary-dark);
}

/* ========== LOGIN & RESET ========== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 80px);
  background: linear-gradient(135deg, var(--primary-color) 40%, #004b91 100%);
}

.login-card {
  background: #fff;
  width: 100%;
  max-width: 380px;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  direction: rtl;
}

.login-card h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.login-card p {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
}

.login-card label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  text-align: right;
}

.login-card input {
  margin-bottom: 15px;
}

.login-card .btn-login {
  width: 100%;
  background-color: var(--primary-color);
}

.forgot-link {
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.error-box {
  background: #ffe5e5;
  color: #b30000;
  padding: 10px;
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  font-size: 14px;
}

/* ========== DASHBOARD ========== */
.dashboard-wrapper {
  display: flex;
  min-height: calc(100vh - 60px);
}



.dashboard-main {
  flex: 1;
  padding: 25px;
}

.dashboard-header {
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 25px;
  padding-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-card i {
  font-size: 40px;
  color: white;
  margin-left: 15px;
  padding: 15px;
  border-radius: 50%;
}

.stat-card h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 16px;
}

.stat-card p {
  font-size: 22px;
  font-weight: bold;
  margin: 5px 0 0;
}

/* Colors */
.stat-card.blue i {
  background-color: var(--accent-blue);
}

.stat-card.green i {
  background-color: var(--accent-green);
}

.stat-card.yellow i {
  background-color: var(--accent-yellow);
}

.stat-card.red i {
  background-color: var(--accent-red);
}

/* ========== TABLES ========== */
.table-container {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

th {
  background-color: var(--primary-color);
  color: white;
}

tr:hover {
  background-color: #11ac03;
}

/* ========== ALERTS / INFO BOXES ========== */
.alert {
  padding: 12px 15px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
}

.alert.info {
  background-color: #e7f3fe;
  color: #084298;
}

.alert.success {
  background-color: #d1e7dd;
  color: #0f5132;
}

.alert.warning {
  background-color: #fff3cd;
  color: #664d03;
}

.alert.error {
  background-color: #f8d7da;
  color: #842029;
}


.center-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
}

.form-card {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  direction: rtl;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .dashboard-main {
    padding: 15px;
  }
}



/* for dashboard */


/* ===== Sidebar ===== */
.sidebar {
  width: 230px;
  background-color: var(--main-color);
  color: var(--white);
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  padding: 1rem;
}

.sidebar h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li a {
  display: block;
  color: var(--white);
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.2s;
}

.sidebar li a:hover,
.sidebar li a.active {
  background-color: #0066cc;
}

/* ===== Main Content ===== */
.main-content {
  margin-right: 30px;
  padding: 20px;
}

/* ===== Cards ===== */
.cards-grid {
  display: grid;
  padding: 20px;
  margin: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  background-color: var(--white);
}

.card {
  padding: 20px;
  border-radius: 12px;
  border: #27ae60 solid 2px;
  box-shadow: 0 2px 5px rgba(19, 18, 16, 0.904);
  text-align: center;
}

/* .overlay{
  background-color: var(--white);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
} */



.card h4 {
  margin-bottom: 10px;
  color: var(--main-color);
  font-weight: bold;
}

.card p {
  font-size: 22px;
  font-weight: bold;
}

/* ===== Alerts Section ===== */
.alerts-section {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.alerts-list {
  list-style: none;
  padding: 0;
}

.alert-item {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-item.absence {
  border-right: 5px solid #e74c3c;
}

.alert-item.lateness {
  border-right: 5px solid #f39c12;
}

.alert-item.policy_violation {
  border-right: 5px solid #8e44ad;
}

.alert-item strong {
  color: var(--main-color);
}

.alert-item .time {
  font-size: 12px;
  color: #666;
}

.no-alerts {
  text-align: center;
  color: #555;
  padding: 15px;
}

/* ovveride */
.text-center{
  text-align: center;
}
.text-right{
  text-align: right;
}

.title{
  color: var(--main-color);
  font-weight: bold;
  padding: auto;
  margin: 15px;
}


.hover-shadow{
  transition: box-shadow 0.3s ease;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.20);
}
.hover-shadow:hover{
  box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.40);
}