/* ===== Global ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f4f7fd;
    color: #333;
}

/* ===== Header ===== */
header {
    width: 100%;
    background: #d2764c;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 22px;
    font-weight: 600;
}

header a {
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s;
}

header a:hover {
    background: rgba(255,255,255,0.4);
}

/* ===== Sidebar ===== */
.sidebar {
    background: #1f2937;
    color: #fff;
    width: 220px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 70px;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 5px;
    margin: 5px 10px;
    transition: all 0.3s ease;
}

.sidebar a:hover {
    background: #007BFF;
}

/* ===== Container ===== */
.container {
    margin-left: 240px;
    padding: 25px 30px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .container {
    margin-left: 70px;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: inline-block;
    width: 220px;
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card.orange {
    background: #ff6b3c;
    color: #fff;
}

/* ===== Login Page ===== */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    padding: 40px 35px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    text-align: center;
    animation: fadeIn 0.8s ease-in-out;
    padding-top: 40px;
}

.login-container h2 {
    margin-bottom: 25px;
    color: #007BFF;
    font-size: 26px;
}

.login-container input[type=text],
.login-container input[type=password] {
    width: 100%;
    padding: 14px 16px;
    margin: 12px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: 0.3s;
}

.login-container input:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 8px rgba(0,123,255,0.4);
}

.login-container button {
    width: 100%;
    padding: 14px;
    background: hsl(238, 100%, 50%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    transition: 0.3s;
}

.login-container button:hover {
    background: #0056b3;
    transform: scale(1.02);
}

.login-container p {
    margin-top: 20px;
    font-size: 14px;
    color: #555;
}

.login-container a {
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
}

.login-container a:hover {
    text-decoration: underline;
}

/* Error message */
.error {
    background: #ffdddd;
    color: #d9534f;
    padding: 10px;
    border: 1px solid #d43f3a;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background: #007BFF;
    color: #fff;
    font-weight: 600;
}

table tr:hover {
    background: #f1f5f9;
}

/* ===== Forms ===== */
.form-section {
    background: #fff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.form-section h2 {
    color: #007BFF;
    margin-bottom: 15px;
}

.form-section input[type=text],
.form-section input[type=password],
.form-section select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.form-section button {
    background: #007BFF;
    color: #fff;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.form-section button:hover {
    background: #0056b3;
    transform: scale(1.02);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container { margin-left: 0; padding: 15px; }
    .sidebar { width: 100%; height: auto; position: relative; padding-top: 15px; }
    .sidebar a { margin: 5px 0; }
}

header {
    background: #007BFF;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

.logout-btn {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border: 1px solid #fff;
    border-radius: 5px;
    transition: 0.3s;
}

.logout-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Sidebar styling */
.sidebar {
    width: 220px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    background: #1e272e;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    z-index: 1000;
}

.sidebar a {
    padding: 15px 20px;
    color: #d2dae2;
    text-decoration: none;
    display: block;
    transition: 0.3s;
}

.sidebar a:hover {
    background: #007BFF;
    color: #fff;
}

.toggle-btn {
    position: absolute;
    top: 10px;
    right: -45px;
    background: #007BFF;
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
}

.toggle-btn:hover {
    background: #0056b3;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed a {
    text-align: center;
    padding: 15px 0;
    font-size: 0;
}

.sidebar.collapsed a::before {
    font-size: 18px;
}

.container.collapsed {
    margin-left: 60px;
}

/* Responsive */
@media(max-width:768px){
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        padding-top: 0;
    }
    .sidebar a {
        flex: 1;
        text-align: center;
        padding: 12px 0;
    }
    .toggle-btn {
        display: none;
    }
    .container {
        margin-left: 0;
    }
}
/* this work to prevent sidebar to hide the header*/
.sidebar {
    top: 70px; /* same as header height */
}

table.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

table.table th, table.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table.table th {
    background: #007BFF;
    color: #fff;
}

table.table tr:hover {
    background: #f1f1f1;
}

@media(max-width:768px){
    table.table th, table.table td { padding: 8px; font-size: 14px; }
}


/*user.php*/
.form-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.form-section h3 {
    color: #007BFF;
    margin-bottom: 15px;
}

.form-section input, .form-section select, .form-section button {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.form-section button {
    background: #007BFF;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.form-section button:hover {
    background: #0056b3;
}

#editModal {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 1002;
}

#editModal .form-section {
    width: 400px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
}
#editModal input, #editModal select, #editModal button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
}
#editModal button {
    background:#007BFF; color:#fff; border:none; cursor:pointer;
}
#editModal button:hover { background:#0056b3; }

#editModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center; /* horizontal center */
    align-items: center;     /* vertical center */
    z-index: 1002;
}

#editModal .form-section {
    width: 400px;
    max-width: 90%;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-in-out;
}

#editModal input, 
#editModal select, 
#editModal button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

#editModal button {
    background:#007BFF; 
    color:#fff; 
    border:none; 
    cursor:pointer;
    transition: 0.3s;
}

#editModal button:hover { 
    background:#0056b3; 
}



/*footer */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
}

.container {
    padding-bottom: 70px; /* same height as footer */
}

footer {
    position: fixed;   /* stick to viewport bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    background: hsl(19, 100%, 50%);
    color: #fff;
    text-align: center;
    padding: 15px 0;
    z-index: 1001;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
}


/*sidebar*?
/* Sidebar */
.sidebar {
    width: 220px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    overflow-y: auto;                     /* scroll if content too long */
    max-height: calc(100vh - 120px);      /* leaves space for header + footer */
    transition: all 0.3s;
}

/* Sidebar links */
.sidebar a {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.3s;
}
.sidebar a:hover {
    background: #007BFF;
    color: #fff;
}

/* Sidebar toggle button */
.toggle-btn {
    background: #007BFF;
    color: #fff;
    border: none;
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 60px;
}
.sidebar.collapsed a {
    text-align: center;
    font-size: 0; /* hide text */
}
.sidebar.collapsed a::before {
    content: attr(data-icon); /* optional: show icon */
    font-size: 18px;
}

/* Container */
.container {
    display: flex;
    gap: 20px;
    padding: 20px;
}
.container.collapsed .main-content {
    margin-left: 60px; /* adjust if sidebar collapsed */
}

/* Responsive for mobile */
@media (max-width:768px){
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
    }
}
/* ===== Global ===== */
* { box-sizing: border-box; margin:0; padding:0; font-family: 'Segoe UI', sans-serif; }
body { background: #f4f7fd; color: #333; min-height:100vh; display:flex; flex-direction:column; }

/* ===== Header ===== */
header {
    width: 100%;
    background:hsl(227, 84%, 50%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: fixed;
    top:0;
    left:0;
    z-index: 1000;
}

header h1 { font-size: 22px; }
header a { color:#fff; text-decoration:none; padding:8px 12px; border-radius:5px; background: rgba(255,255,255,0.2); }
header a:hover { background: rgba(255,255,255,0.4); }

/* ===== Sidebar ===== */
.sidebar {
    background: #1f2937;
    color:#fff;
    width:220px;
    position: fixed;
    top: 70px; /* below header */
    left:0;
    height: calc(100vh - 70px);
    padding-top: 20px;
    display:flex;
    flex-direction: column;
    transition: all 0.3s;
    overflow-y: auto;
    border-right: 1px solid #ddd;
}

.sidebar a {
    display:block;
    color:#fff;
    text-decoration:none;
    padding:12px 20px;
    margin:5px 10px;
    border-radius:5px;
    transition:0.3s;
}

.sidebar a:hover { background:#007BFF; }
.toggle-btn { background:#007BFF; color:#fff; border:none; padding:10px; margin:5px 10px; border-radius:5px; cursor:pointer; }
.sidebar.collapsed { width:60px; }
.sidebar.collapsed a { text-align:center; font-size:0; }
.sidebar.collapsed a::before { content: attr(data-icon); font-size:18px; }

/* ===== Container ===== */
.container { display:flex; margin-top:70px; padding:20px; transition: margin-left 0.3s; }
.container.collapsed .main-content { margin-left:60px; }

/* ===== Main content ===== */
.main-content { flex:1; padding:20px; background:#f4f7fd; min-height: calc(100vh - 70px); }

/* ===== Footer ===== */
footer {
    background:hsl(227, 84%, 50%);
    color:#fff;
    text-align:center;
    padding:15px 0;
    margin-top:auto;
}

/* ===== Responsive ===== */
@media(max-width:768px){
    .container { flex-direction: column; }
    .sidebar { width:100%; height:auto; position:relative; top:0; }
    .sidebar a { margin:5px 0; }
    .toggle-btn { display:none; }
}

/* Toggle Button inside sidebar */
.toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px; /* inside sidebar, not floating far */
    width: 35px;
    height: 35px;
    background: #007BFF;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    margin: 4px 8px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    border-radius: 6px;
    transition: 0.3s;
}

.sidebar a::before {
    content: attr(data-icon);
    font-size: 18px;
    width: 25px;
    text-align: center;
}

.sidebar a:hover {
    background: #007BFF;
}

.sidebar.collapsed a {
    justify-content: center; /* center icon only */
    font-size: 0; /* hide text */
}

.sidebar.collapsed a::before {
    margin: 0;
    font-size: 20px; /* make icon bigger */
}

/* Make main-content respect sidebar and display heading above content */
.main-content {
    margin-left: 240px; /* same as sidebar width */
    padding: 20px;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

.page-heading {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.page-heading h2 {
    margin: 0;
    font-size: 22px;
    color: #007BFF;
}

/*dashboard  analytic*/
.cards-wrapper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    padding: 15px;
    font-size: 14px;
    width: 100%;
    text-align: center;
}

.charts-wrapper {
    margin-top: 30px;
}

/* Responsive adjustments */
@media(max-width:1200px){ .cards-wrapper { grid-template-columns: repeat(3,1fr); } }
@media(max-width:992px){ .cards-wrapper { grid-template-columns: repeat(2,1fr); } }
@media(max-width:768px){ .cards-wrapper { grid-template-columns: 1fr; } }

.container > .first-section {
  display: grid;
  grid-template-columns: 1fr; /* single column */
  row-gap: 10px;
  margin-bottom: 5%;
  max-width: 1100px;    /* limit width, adjust as needed */
  padding: 20px;        /* inner spacing */
  background: #e6e7e9;  /* subtle background (optional) */
  border-radius: 15px;   /* rounded corners */
  box-shadow: 0 2px 8px rgba(211, 83, 15, 0.854); /* professional look */
}


/*login page heading*/
.page-title {
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #0d6efd; /* optional styling */
  margin-top: 40px;
}
