/* Iran Catalyst Portal UI — shared production skin
   Purpose: typography + restrained visual system only.
   Business logic, layout structure and workflow are intentionally untouched. */

@font-face {
    font-family: 'IranSansPortal';
    src:
        url('https://irancatalyst.ir/wp-content/themes/Javan/fonts/iransans.woff2') format('woff2'),
        url('https://irancatalyst.ir/wp-content/themes/Javan/fonts/iransans.woff') format('woff'),
        url('https://irancatalyst.ir/wp-content/themes/Javan/fonts/iransans.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --ic-bg: #f5f8fb;
    --ic-surface: #ffffff;
    --ic-surface-soft: #f8fbfd;
    --ic-surface-blue: #eef6fb;
    --ic-line: #dce6ed;
    --ic-line-soft: #e9eff4;
    --ic-text: #263746;
    --ic-muted: #6f8190;
    --ic-heading: #1f3445;
    --ic-primary: #2878a8;
    --ic-primary-hover: #1f638d;
    --ic-primary-soft: #eaf4fa;
    --ic-success: #168060;
    --ic-success-soft: #ecf8f3;
    --ic-warning: #a86a16;
    --ic-warning-soft: #fff7e8;
    --ic-danger: #b34747;
    --ic-danger-soft: #fff0f0;
    --ic-radius-sm: 9px;
    --ic-radius-md: 13px;
    --ic-radius-lg: 17px;
    --ic-shadow: 0 7px 24px rgba(33, 55, 72, .045);
}

html,
body,
button,
input,
textarea,
select,
option,
table,
th,
td {
    font-family: 'IranSansPortal', Tahoma, Arial, sans-serif !important;
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
    background: var(--ic-bg) !important;
    color: var(--ic-text) !important;
    font-weight: 400 !important;
    line-height: 1.85;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ic-heading);
    line-height: 1.55;
    letter-spacing: 0;
}
h1, h2 { font-weight: 700 !important; }
h3, h4, h5, h6 { font-weight: 600 !important; }
b, strong { font-weight: 600 !important; }
small, .hint, .meta, .date-text { color: var(--ic-muted); font-weight: 400 !important; }

/* Main surfaces */
.card,
.stat-card,
.ic-wallet-card,
.ic-profile-card,
.ic-profile-hero,
.top,
.top-bar,
.register-wrapper,
.login-card,
.login-box,
.box,
.panel,
.content-card {
    background: var(--ic-surface) !important;
    border-color: var(--ic-line-soft) !important;
    box-shadow: var(--ic-shadow) !important;
}

.card,
.stat-card,
.ic-wallet-card,
.ic-profile-card,
.ic-profile-hero,
.top,
.register-wrapper {
    border-radius: var(--ic-radius-lg) !important;
}

.info,
.ic-profile-field,
.ic-profile-stat,
.empty,
.activity,
.preview,
.admin-mode,
.ic-profile-security-note {
    border-color: var(--ic-line-soft) !important;
}

/* Sidebar / navigation: light and calm */
.sidebar {
    background: #ffffff !important;
    color: var(--ic-text) !important;
    border-left: 1px solid var(--ic-line) !important;
    box-shadow: -4px 0 22px rgba(33,55,72,.035) !important;
}
.sidebar-header {
    background: #ffffff !important;
    color: var(--ic-heading) !important;
    border-bottom: 1px solid var(--ic-line-soft) !important;
}
.nav-item,
.menu-item {
    color: #526675 !important;
    border-color: transparent !important;
    font-weight: 500 !important;
}
.nav-item:hover,
.nav-item.active,
.menu-item:hover,
.menu-item.active {
    background: var(--ic-primary-soft) !important;
    color: var(--ic-primary) !important;
}

/* Forms */
input,
textarea,
select {
    background: #fff !important;
    color: var(--ic-text) !important;
    border: 1px solid var(--ic-line) !important;
    border-radius: var(--ic-radius-sm) !important;
    font-weight: 400 !important;
    outline: none;
}
input:focus,
textarea:focus,
select:focus {
    border-color: #89bdd8 !important;
    box-shadow: 0 0 0 3px rgba(40,120,168,.09) !important;
    background: #fff !important;
}
input::placeholder,
textarea::placeholder { color: #9aaab5; opacity: 1; }
label { color: #465e6f; font-weight: 500 !important; }

/* Buttons — actions stay intentionally colored */
button,
.btn,
.customer-action,
.ic-profile-btn,
.btn-register,
.btn-login,
input[type='submit'] {
    font-weight: 600 !important;
    border-radius: var(--ic-radius-sm) !important;
    box-shadow: none !important;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease !important;
}
button:not(.light):not(.dark):not(.danger):not(.remove-btn),
.btn:not(.light):not(.dark):not(.danger),
.customer-action,
.ic-profile-btn--primary,
.btn-register,
.btn-login,
input[type='submit'] {
    background: var(--ic-primary) !important;
    border-color: var(--ic-primary) !important;
    color: #fff !important;
}
button:not(.light):not(.dark):not(.danger):not(.remove-btn):hover,
.btn:not(.light):not(.dark):not(.danger):hover,
.customer-action:hover,
.ic-profile-btn--primary:hover,
.btn-register:hover,
.btn-login:hover,
input[type='submit']:hover {
    background: var(--ic-primary-hover) !important;
    border-color: var(--ic-primary-hover) !important;
}
.btn.light,
.ic-profile-btn--light {
    background: var(--ic-primary-soft) !important;
    border: 1px solid #cfe4ef !important;
    color: var(--ic-primary) !important;
}
.btn.dark,
.ic-profile-btn--dark {
    background: #425c6d !important;
    border-color: #425c6d !important;
    color: #fff !important;
}
.btn.danger,
.ic-profile-btn--danger,
.remove-btn {
    background: var(--ic-danger-soft) !important;
    border-color: #f1cccc !important;
    color: var(--ic-danger) !important;
}

/* Tables and record control */
table { background: #fff; }
th {
    background: #f4f8fb !important;
    color: #607584 !important;
    border-color: var(--ic-line) !important;
    font-weight: 600 !important;
}
td {
    color: var(--ic-text);
    border-color: var(--ic-line-soft) !important;
    font-weight: 400 !important;
}
tbody tr:hover { background: #fbfdff; }

/* Links */
a { text-underline-offset: 3px; }
.customer-link,
.link,
.back { color: var(--ic-primary) !important; font-weight: 600 !important; }

/* Statuses retain semantic colors, but in soft tones */
.badge,
.pill { font-weight: 500 !important; border: 1px solid transparent; }
.st-info,
.pill:not(.closed):not(.warn) { background: #edf6fb !important; color: #276f98 !important; }
.st-success { background: var(--ic-success-soft) !important; color: var(--ic-success) !important; }
.st-waiting,
.warn { background: var(--ic-warning-soft) !important; color: var(--ic-warning) !important; }
.st-danger,
.closed { background: #f2f4f6 !important; color: #687985 !important; }
.st-process { background: #edf4ff !important; color: #356aa0 !important; }

/* Workflow/document indicators */
.dot { background: #e4ebf0 !important; border-color: #d1dce3 !important; box-shadow: none !important; }
.dot.active { background: var(--ic-primary) !important; border-color: var(--ic-primary) !important; box-shadow: none !important; }

/* Alerts */
.alert.ok,
.flash.ok,
.ic-profile-flash--success { background: var(--ic-success-soft) !important; color: #17664f !important; border-color: #bfe5d7 !important; }
.alert.err,
.flash.err,
.error,
.ic-profile-flash--error { background: var(--ic-danger-soft) !important; color: #983f3f !important; border-color: #efcaca !important; }
.admin-mode { background: #f4f8fb !important; color: #526b7c !important; border-color: var(--ic-line) !important; }

/* Reduce overly-heavy legacy typography */
.stat-card p,
.stat b,
.ic-wallet-balance,
.ic-profile-stat b,
.ic-wallet-tx-credit,
.ic-wallet-tx-debit,
.customer-link,
.customer-action {
    font-weight: 700 !important;
}

/* Finance preview: keep it visually distinct without dark teal gradients */
.preview {
    background: #edf6fb !important;
    color: var(--ic-heading) !important;
    border: 1px solid #d4e6f0 !important;
}
.preview-row { border-color: #d8e6ee !important; }
.switch { background: #f2f8fc !important; border-color: #cfe3ef !important; }
.flag { background: #edf6fb !important; color: #276f98 !important; }
.flag.off { background: #f3f5f7 !important; color: #7b8993 !important; }

/* Wallet hero: light professional treatment */
.ic-wallet-hero {
    background: linear-gradient(135deg,#f7fbfd 0%,#edf6fb 100%) !important;
    color: var(--ic-heading) !important;
    border: 1px solid #dce9f0 !important;
}
.ic-wallet-hero:before,
.ic-wallet-hero:after { opacity: .18 !important; }
.ic-wallet-eyebrow,
.ic-wallet-mini,
.ic-wallet-mini span { color: #627887 !important; }

/* Scrollbars — subtle */
* { scrollbar-width: thin; scrollbar-color: #cbd8e0 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cbd8e0; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 760px) {
    body { line-height: 1.75; }
    h1, h2 { line-height: 1.5; }
}
