* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: Arial, sans-serif;
    background: #f6f6f6;
    color: #111;
    overflow-x: hidden;
}

/* Layout */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

#sidebar-placeholder {
    width: 280px;
    flex: 0 0 280px;
    background: #101820;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    background: #101820;
    color: white;
    padding: 28px 18px;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 0 32px 40px;
}

/* Sidebar */
.logo {
    text-align: center;
    margin-bottom: 38px;
}

.logo img {
    width: 150px;
    height: auto;
}

.nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: bold;
}

.nav a.active,
.nav a:hover {
    background: linear-gradient(90deg, #ff2f16, #ff7a00);
}

/* Topbar */
.topbar {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6e6e6;
    margin-bottom: 28px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
}

.topbar p {
    margin: 8px 0 0;
    color: #777;
    font-size: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user span {
    background: white;
    border: 1px solid #eee;
    padding: 10px 14px;
    border-radius: 10px;
}

/* Cards */
.card,
.page-card,
.table-card,
.form-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin-bottom: 22px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat h3 {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.stat strong {
    display: block;
    font-size: 30px;
    margin-top: 10px;
}

/* Forms */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 12px;
    background: white;
}

textarea {
    min-height: 80px;
}

/* Buttons */
.btn {
    background: linear-gradient(90deg, #ff2f16, #ff7a00);
    color: white;
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
}

.btn-light,
.topbar-user button {
    background: white;
    color: #ff3b16;
    border: 1px solid #ff3b16;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid #eee;
    text-align: right;
    font-size: 14px;
}

th {
    background: #fafafa;
    font-weight: bold;
}

.actions button {
    margin-left: 6px;
}

/* Badges */
.badge {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.success {
    background: #e7f8e7;
    color: #0b8f27;
}

.danger {
    background: #ffe8e8;
    color: #d71919;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111820;
}

.login-card {
    width: 380px;
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    text-align: center;
}

.login-card h1 {
    color: #ff5a16;
    margin-bottom: 5px;
}

.login-card p {
    color: #555;
    margin-bottom: 25px;
}

.error-text {
    margin-top: 15px;
    color: #d71919;
    font-weight: bold;
}

/* Hide old headers */
.header,
.page-title,
.old-header,
.page-header {
    display: none;
}
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    width: 680px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 18px;
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    border: 0;
    background: #f3f3f3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
}