@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Vazirmatn:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-light: #f3e8ff;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --success: #10b981;
    --success-bg: #d1fae5;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px -2px rgba(124, 58, 237, 0.06), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 40px -15px rgba(124, 58, 237, 0.1), 0 10px 20px -5px rgba(0,0,0,0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Header / Top Bar */
.top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #2e263d, #1c1526); /* Modern Charcoal-Purple */
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 5px;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    color: #e2e8f0;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 28px auto;
    padding: 0 16px;
}

/* Card Styling */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.card h2, .card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

/* Info Details */
.info p {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.info p b {
    color: var(--muted);
    min-width: 100px;
    display: inline-block;
}

/* Grids */
.grid3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card strong {
    font-size: 38px;
    font-weight: 700;
    color: var(--primary-hover);
    display: block;
    margin-top: 8px;
    line-height: 1;
}

.card span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.row h2 {
    margin-bottom: 0;
}

/* Buttons */
.btn, button {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: 0;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    transition: all 0.2s ease;
}

.btn:hover, button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
    opacity: 0.95;
}

.linkbtn {
    background: none;
    color: var(--primary-hover);
    padding: 4px 8px;
    box-shadow: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.linkbtn:hover {
    background: var(--primary-light);
    transform: none;
    box-shadow: none;
}

/* Form Inputs */
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 6px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.formgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

.search {
    display: flex;
    gap: 10px;
    margin: 18px 0;
}

.search input {
    margin: 0;
    background: #fff;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
}

th, td {
    text-align: right;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    border-bottom: 2px solid var(--line);
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background-color: #faf5ff;
}

.muted {
    color: var(--muted);
}

.alert {
    background: var(--danger-bg);
    color: #991b1b;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-weight: 500;
    border: 1px solid #fee2e2;
    font-size: 13px;
}

.danger td {
    background: #fff1f2 !important;
    color: #9f1239;
}

.danger:hover td {
    background: #ffe4e6 !important;
}

/* Notes List */
.note {
    border-right: 4px solid var(--primary);
    background: #faf8ff;
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 14px 0;
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-right: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}

.note b {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.note p {
    color: #334155;
    font-size: 13.5px;
    white-space: pre-wrap;
}

/* Upload Fields */
input[type="file"] {
    background: #fff;
    border: 1px dashed var(--primary);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 12px;
}

/* Login Page UI */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #f3e8ff, #f8fafc);
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 20px 40px -15px rgba(124, 58, 237, 0.08);
    width: min(410px, 92vw);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-logo {
    width: 86px;
    height: 86px;
    display: block;
    margin: 0 auto 10px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 8px;
    object-fit: contain;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.login-card h1 {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-card label {
    margin-bottom: 2px;
}

.login-card button {
    margin-top: 8px;
    padding: 13px;
    font-size: 14px;
}

/* Responsive UI */
@media (max-width: 768px) {
    .top {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }
    
    nav {
        justify-content: center;
    }
    
    .grid3, .grid2, .formgrid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 10px 14px;
    }
    
    .brand img {
        width: 38px;
        height: 38px;
    }
    
    .container {
        margin: 16px auto;
    }
}
