/* =========================================
ASAN HISAB
Main Stylesheet
Version: 1.0.0
========================================= */

/* ---------- Design Tokens ---------- */

:root {
color-scheme: light;

--primary: #398fc2;
--primary-dark: #2878a8;
--primary-light: #e8f4fb;

--background: #f1f6fa;
--surface: #ffffff;
--surface-muted: #f7fafd;

--text: #202833;
--text-muted: #758395;

--border: #dfe7ee;
--success: #168653;
--danger: #d63838;
--warning: #b7791f;

--radius-sm: 8px;
--radius-md: 14px;
--radius-lg: 22px;

--shadow-sm: 0 4px 14px rgba(24, 45, 90, 0.05);
--shadow-md: 0 12px 32px rgba(24, 45, 90, 0.09);

--container: 1160px;

--font: Tahoma, Arial, sans-serif;

}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
box-sizing: border-box;
}

html {
min-height: 100%;
scroll-behavior: smooth;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}

body {
min-width: 320px;
margin: 0;
font-family: var(--font);
font-size: 15px;
line-height: 1.8;
color: var(--text);
background: var(--background);
direction: inherit;
}

button,
input,
select,
textarea {
font: inherit;
}

button,
a {
-webkit-tap-highlight-color: transparent;
}

button {
cursor: pointer;
}

button:disabled {
cursor: not-allowed;
opacity: 0.6;
}

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

img,
svg {
max-width: 100%;
}

img {
height: auto;
}

h1,
h2,
h3,
h4,
p {
margin-top: 0;
}

h1,
h2,
h3,
h4 {
line-height: 1.4;
}

::selection {
color: #ffffff;
background: var(--primary);
}

/* ---------- Accessibility ---------- */

:focus-visible {
outline: 3px solid rgba(57, 143, 194, 0.45);
outline-offset: 3px;
}

.skip-link {
position: absolute;
z-index: 1000;
top: 8px;
inset-inline-start: 8px;
padding: 10px 16px;
color: #ffffff;
background: var(--primary-dark);
border-radius: var(--radius-sm);
transform: translateY(-150%);
}

.skip-link:focus {
transform: translateY(0);
}

/* ---------- Shared Layout ---------- */

.container {
width: min(calc(100% - 40px), var(--container));
margin-inline: auto;
}

.section {
padding-block: 76px;
}

.section-heading {
max-width: 700px;
margin: 0 auto 38px;
text-align: center;
}

.section-heading h2 {
margin-bottom: 12px;
font-size: clamp(25px, 3vw, 36px);
font-weight: 800;
}

.section-heading p {
margin-bottom: 0;
color: var(--text-muted);
}

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

.text-center {
text-align: center;
}

.hidden {
display: none !important;
}

/* ---------- Brand ---------- */

.brand {
display: inline-flex;
align-items: center;
gap: 11px;
flex-shrink: 0;
font-size: 20px;
font-weight: 800;
}

.brand-mark {
display: grid;
width: 43px;
height: 43px;
place-items: center;
color: #ffffff;
background: var(--primary);
border-radius: 13px;
font-size: 23px;
font-weight: 900;
}

.brand-text {
display: flex;
flex-direction: column;
line-height: 1.3;
}

.brand-text small {
margin-top: 3px;
color: var(--text-muted);
font-size: 10px;
font-weight: 600;
letter-spacing: 1px;
}

/* ---------- Header ---------- */

.site-header {
position: sticky;
z-index: 100;
top: 0;
background: rgba(255, 255, 255, 0.96);
border-bottom: 1px solid var(--border);
backdrop-filter: blur(14px);
-webkit-backdrop-filter: blur(14px);
}

.header-inner {
display: flex;
min-height: 76px;
align-items: center;
justify-content: space-between;
gap: 20px;
}

.header-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 12px;
}

.language-select {
min-height: 42px;
max-width: 150px;
padding: 8px 12px;
color: var(--text);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}

.header-login {
display: inline-flex;
min-height: 42px;
align-items: center;
justify-content: center;
padding: 8px 17px;
color: var(--primary-dark);
border: 1px solid var(--primary);
border-radius: var(--radius-sm);
font-weight: 700;
transition: background 0.2s, color 0.2s;
}

.header-login:hover {
color: #ffffff;
background: var(--primary);
}

/* ---------- Buttons ---------- */

.btn {
display: inline-flex;
min-height: 48px;
align-items: center;
justify-content: center;
gap: 8px;
padding: 11px 23px;
border: 1px solid transparent;
border-radius: var(--radius-sm);
font-weight: 700;
line-height: 1.5;
text-align: center;
transition:
transform 0.2s ease,
background 0.2s ease,
box-shadow 0.2s ease;
}

.btn:hover {
transform: translateY(-2px);
}

.btn-primary {
color: #ffffff;
background: var(--primary);
box-shadow: 0 7px 18px rgba(57, 143, 194, 0.18);
}

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

.btn-secondary {
color: var(--primary-dark);
background: #ffffff;
border-color: var(--border);
}

.btn-secondary:hover {
background: var(--primary-light);
border-color: #c6dfef;
}

.btn-block {
width: 100%;
}

.btn-sm {
min-height: 38px;
padding: 7px 14px;
font-size: 13px;
}

/* ---------- Forms ---------- */

.form-container {
width: min(calc(100% - 32px), 480px);
margin: 44px auto;
}

.form-card {
padding: 30px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
}

.form-title {
margin-bottom: 8px;
font-size: 26px;
font-weight: 800;
}

.form-description {
margin-bottom: 25px;
color: var(--text-muted);
font-size: 14px;
}

.form-group {
margin-bottom: 19px;
}

.form-group label {
display: block;
margin-bottom: 7px;
font-size: 13px;
font-weight: 700;
}

.form-control {
display: block;
width: 100%;
min-height: 47px;
padding: 11px 13px;
color: var(--text);
background: #ffffff;
border: 1px solid #d8dfeb;
border-radius: var(--radius-sm);
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(57, 143, 194, 0.12);
}

.form-control::placeholder {
color: #98a2b3;
}

.form-error {
margin-top: 6px;
color: var(--danger);
font-size: 12px;
}

.form-help {
margin-top: 6px;
color: var(--text-muted);
font-size: 12px;
}

.form-footer {
margin-top: 20px;
color: var(--text-muted);
font-size: 13px;
text-align: center;
}

.form-footer a {
color: var(--primary-dark);
font-weight: 700;
}

/* ---------- Cards ---------- */

.card {
min-width: 0;
padding: 22px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
}

.card-title {
margin-bottom: 16px;
font-size: 18px;
font-weight: 800;
}

.card-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 18px;
}

/* ---------- Page Layout ---------- */

.page-container {
width: min(calc(100% - 40px), var(--container));
margin: 32px auto 60px;
}

.page-header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 16px;
margin-bottom: 25px;
}

.page-header h1 {
margin-bottom: 5px;
font-size: clamp(24px, 3vw, 32px);
}

.page-header p {
margin-bottom: 0;
color: var(--text-muted);
font-size: 13px;
}

/* ---------- Navigation ---------- */

.main-nav {
display: flex;
flex-wrap: wrap;
gap: 8px;
}

.main-nav a {
padding: 8px 13px;
color: var(--text-muted);
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 700;
}

.main-nav a:hover,
.main-nav a.active {
color: var(--primary-dark);
background: var(--primary-light);
}

/* ---------- Dashboard Statistics ---------- */

.stat-card {
min-width: 0;
padding: 21px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
}

.stat-card span {
display: block;
margin-bottom: 8px;
color: var(--text-muted);
font-size: 12px;
}

.stat-card strong {
display: block;
overflow-wrap: anywhere;
font-size: clamp(20px, 2.5vw, 28px);
}

.stat-card small {
display: block;
margin-top: 6px;
color: var(--text-muted);
font-size: 11px;
}

.dashboard-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
margin-top: 22px;
}

/* ---------- Tables ---------- */

.table-wrapper {
width: 100%;
overflow-x: auto;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
}

.data-table {
width: 100%;
border-collapse: collapse;
white-space: nowrap;
}

.data-table th,
.data-table td {
padding: 13px 16px;
border-bottom: 1px solid var(--border);
text-align: start;
}

.data-table th {
color: var(--text-muted);
background: var(--surface-muted);
font-size: 12px;
font-weight: 800;
}

.data-table td {
font-size: 13px;
}

.data-table tbody tr:last-child td {
border-bottom: 0;
}

.data-table tbody tr:hover {
background: #fafcff;
}

/* ---------- Status Labels ---------- */

.status {
display: inline-flex;
align-items: center;
padding: 4px 10px;
border-radius: 999px;
font-size: 11px;
font-weight: 700;
}

.status-success {
color: #126b43;
background: #e5f7ed;
}

.status-warning {
color: #8a5a0a;
background: #fff4d8;
}

.status-danger {
color: #a91f1f;
background: #ffe8e8;
}

.status-neutral {
color: #526075;
background: #edf0f5;
}

/* ---------- Alerts ---------- */

.alert {
margin-bottom: 18px;
padding: 13px 16px;
border: 1px solid transparent;
border-radius: var(--radius-sm);
font-size: 13px;
}

.alert-success {
color: #126b43;
background: #e8f8ef;
border-color: #c7ecd6;
}

.alert-error {
color: #a91f1f;
background: #fff0f0;
border-color: #ffd2d2;
}

.alert-warning {
color: #82570d;
background: #fff7e3;
border-color: #f4e0ad;
}

.alert-info {
color: #1944b0;
background: #edf3ff;
border-color: #d4e1ff;
}

/* ---------- Empty States ---------- */

.empty-state {
padding: 42px 20px;
color: var(--text-muted);
text-align: center;
}

.empty-state h3 {
margin-bottom: 8px;
color: var(--text);
}

.empty-state p {
margin-bottom: 0;
font-size: 13px;
}

/* ---------- Loading ---------- */

.loading {
padding: 24px;
color: var(--text-muted);
text-align: center;
}

.loading-spinner {
display: inline-block;
width: 24px;
height: 24px;
border: 3px solid var(--border);
border-top-color: var(--primary);
border-radius: 50%;
animation: asan-spin 0.8s linear infinite;
vertical-align: middle;
}

@keyframes asan-spin {
to {
transform: rotate(360deg);
}
}

/* ---------- Premium ---------- */

.premium-card {
padding: 30px;
background: linear-gradient(135deg, #ffffff, #f0f7ff);
border: 1px solid #d6e8f7;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
}

.premium-price {
margin-block: 15px;
color: var(--primary-dark);
font-size: clamp(28px, 4vw, 40px);
font-weight: 900;
}

.premium-features {
margin-block: 22px;
}

/* ---------- Footer ---------- */

.site-footer {
padding-block: 28px;
background: #ffffff;
border-top: 1px solid var(--border);
}

.footer-inner {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 14px;
}

.footer-inner p {
margin: 0;
color: var(--text-muted);
font-size: 12px;
}

.footer-links {
display: flex;
flex-wrap: wrap;
gap: 18px;
}

.footer-links a {
color: var(--text-muted);
font-size: 12px;
}

.footer-links a:hover {
color: var(--primary-dark);
}

/* ---------- Utility Classes ---------- */

.flex {
display: flex;
}

.flex-wrap {
flex-wrap: wrap;
}

.items-center {
align-items: center;
}

.justify-between {
justify-content: space-between;
}

.gap-sm {
gap: 8px;
}

.gap-md {
gap: 16px;
}

.gap-lg {
gap: 24px;
}

.mt-1 {
margin-top: 8px;
}

.mt-2 {
margin-top: 16px;
}

.mt-3 {
margin-top: 24px;
}

.mb-1 {
margin-bottom: 8px;
}

.mb-2 {
margin-bottom: 16px;
}

.mb-3 {
margin-bottom: 24px;
}

/* ---------- Direction Support ---------- */

html[dir="rtl"] {
direction: rtl;
}

html[dir="ltr"] {
direction: ltr;
}

[dir="ltr"] .data-table th,
[dir="ltr"] .data-table td {
text-align: left;
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
text-align: right;
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}