/* ============================================================
   Amanat App - Modern Theme (app.amanatit.com)
   RTL Persian admin design: dark sidebar + light content
   ============================================================ */

* { padding: 0; margin: 0; box-sizing: border-box; }
ul { list-style: none; }
a { text-decoration: none !important; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f1f4fa;
    color: #27334d;
    font-size: 0.95rem;
}

/* ===================== APP SHELL ===================== */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 265px;
    background: linear-gradient(180deg, #101c3f 0%, #172a5e 45%, #1b3a7a 100%);
    color: #dfe7ff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -4px 0 24px rgba(16, 28, 63, 0.25);
    transition: transform 0.3s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.4rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border-radius: 12px;
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 6px 14px rgba(0, 242, 254, 0.35);
}
.brand-text { font-weight: 800; font-size: 1.1rem; color: #fff; letter-spacing: -0.3px; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 0.6rem;
}
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0.2rem;
    border-radius: 10px;
    color: #b9c6ef;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.sidebar-nav .nav-item i { width: 20px; text-align: center; font-size: 0.95rem; opacity: 0.85; }
.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(-4px);
}
.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, #4facfe, #1e5ef3);
    color: #fff;
    box-shadow: 0 6px 14px rgba(30, 94, 243, 0.4);
}
.sidebar-footer {
    padding: 0.8rem 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer .nav-item.exit { color: #ffb4b4; }
.sidebar-footer .nav-item.exit:hover { background: rgba(255, 80, 80, 0.15); color: #fff; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 40, 0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ---------- Main area ---------- */
.app-main { flex: 1; margin-right: 265px; display: flex; flex-direction: column; min-height: 100vh; }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    padding: 0.7rem 1.4rem;
    box-shadow: 0 2px 10px rgba(16, 28, 63, 0.08);
    border-bottom: 1px solid #e8edf7;
}
.topbar-toggle {
    border: none;
    background: #eef2fb;
    width: 42px; height: 42px;
    border-radius: 10px;
    color: #1b3a7a;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
}
.topbar-toggle:hover { background: #dfe7fa; }
.topbar-title {
    font-weight: 700;
    color: #1b3a7a;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.topbar-title i { color: #1e5ef3; }
.topbar-company {
    margin-right: auto;
    font-weight: 600;
    color: #55618a;
    font-size: 0.88rem;
    background: #f1f4fa;
    padding: 0.45rem 1rem;
    border-radius: 30px;
}

.app-content { flex: 1; padding: 1.6rem; }

.app-footer {
    text-align: center;
    padding: 1rem;
    color: #8b96b8;
    font-size: 0.78rem;
    border-top: 1px solid #e8edf7;
}

/* ===================== DASHBOARD ===================== */
#dashboard {
    padding-right: 0 !important;
    padding-left: 0 !important;
    font-size: 1rem !important;
    line-height: 1.8 !important;
    color: #27334d !important;
}
#dashboard h2, #amounts h2, #checks h2 {
    font-weight: 800;
    color: #1b3a7a;
    font-size: 1.35rem;
    margin: 0.5rem 0 0.2rem;
}
#amounts h3, #checks h3, #wallets h3 {
    font-weight: 700;
    color: #34405f;
    font-size: 1.05rem;
    margin: 1.2rem 0 0.8rem;
}
#dashboard .bottom-line {
    background: linear-gradient(90deg, #1e5ef3, #4facfe);
    width: 70px;
    height: 4px;
    margin: 0.5rem auto 1.2rem;
    border-radius: 4px;
}

/* Dashboard money cards */
#dashboard .card {
    position: relative;
    color: #fff !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.3rem 1rem;
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 22px rgba(16, 28, 63, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
#dashboard .card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(16, 28, 63, 0.2); }
#dashboard .card .title { font-weight: 700; font-size: 0.95rem; opacity: 0.92; margin-bottom: 0.4rem; }
#dashboard .card .amount { font-weight: 800; font-size: 1.25rem; letter-spacing: 0.5px; }
#dashboard .card::before { display: none; }

#wallets .card { background: linear-gradient(135deg, #11998e, #38ef7d); }
#banks .card   { background: linear-gradient(135deg, #1e5ef3, #4facfe); }
#customers .card { background: linear-gradient(135deg, #7f00ff, #e100ff); }
#owners .card  { background: linear-gradient(135deg, #fc5c7d, #6a82fb); }
#profits .card { background: linear-gradient(135deg, #0ba360, #3cba92); }
#expenses .card { background: linear-gradient(135deg, #f953c6, #b91d73); }
#checks .card { background: linear-gradient(135deg, #f2994a, #f2c94c); }

/* ===================== LOGIN ===================== */
.login-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #101c3f 0%, #1b3a7a 55%, #1e5ef3 100%);
}
.login-brand {
    text-align: center;
    color: #fff;
    margin-bottom: 1.6rem;
}
.login-brand .brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border-radius: 18px;
    font-size: 1.6rem;
    box-shadow: 0 12px 30px rgba(0, 242, 254, 0.4);
}
.login-brand .brand-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}
.login-brand p {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}
#login {
    width: 100%;
    max-width: 420px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 20px;
    padding: 2.2rem 2rem;
    box-shadow: 0 24px 60px rgba(8, 16, 40, 0.45);
    position: relative;
}
#login h1, #login .login-logo {
    text-align: center;
    margin-bottom: 1.4rem;
}
#login .form-group { margin-bottom: 1.2rem; }
#login label {
    display: block;
    font-weight: 600;
    color: #34405f;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
}
#login input[type="text"], #login input[type="password"] {
    width: 100%;
    border: 2px solid #e2e8f5;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8faff;
    outline: none;
}
#login input:focus { border-color: #1e5ef3; box-shadow: 0 0 0 4px rgba(30, 94, 243, 0.15); }
#login button {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e5ef3, #4facfe);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.02rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 18px rgba(30, 94, 243, 0.35);
    margin-top: 0.5rem;
}
#login button:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(30, 94, 243, 0.45); }
#login .error {
    border-radius: 12px;
    border: none;
    background: #fff3f3;
    color: #c0392b;
    font-size: 0.9rem;
    padding: 1rem !important;
}
#login .success {
    background: #eafaf1;
    color: #1e8449;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.95rem;
}
#login .loader { position: absolute; border-radius: 20px; background: rgba(16, 28, 63, 0.75); }

/* Override LoginComponent scoped styles (compiled in JS) */
#login form {
    background: #fff !important;
    border-radius: 20px !important;
    padding: 1.6rem 1.4rem !important;
    margin: 0 !important;
    opacity: 1 !important;
    box-shadow: 0 24px 60px rgba(8, 16, 40, 0.45);
}
#login .form-group { padding: 0.5rem 0 !important; }
#login .form-group input {
    padding: 0.8rem 1rem !important;
    border: 2px solid #e2e8f5 !important;
    border-radius: 12px !important;
    background: #f8faff !important;
}

/* ===================== DATA PAGES (tables, forms) ===================== */
.card {
    background: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(16, 28, 63, 0.07);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eef1f8;
    border-radius: 14px 14px 0 0 !important;
    font-weight: 700;
    color: #1b3a7a;
    padding: 0.9rem 1.2rem;
}
.table { margin: 0; }
.table thead th {
    background: #f4f7fd;
    color: #34405f;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 2px solid #e2e8f5;
    white-space: nowrap;
}
.table td {
    vertical-align: middle;
    border-top: 1px solid #eef1f8;
    font-size: 0.9rem;
}
.table tbody tr:hover { background: #f8faff; }

.form-control, .form-select, select.form-control {
    border: 2px solid #e2e8f5;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-family: inherit;
    font-size: 0.92rem;
    background-color: #f8faff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: #1e5ef3; box-shadow: 0 0 0 4px rgba(30, 94, 243, 0.12); }

.btn {
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #1e5ef3, #4facfe);
    border: none;
    box-shadow: 0 6px 14px rgba(30, 94, 243, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border: none;
    box-shadow: 0 6px 14px rgba(17, 153, 142, 0.3);
}
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #fc5c7d);
    border: none;
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.3);
}

/* Pagination / navigation component */
#navigation-controls {
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 18px rgba(16, 28, 63, 0.07) !important;
    padding: 1rem 1.2rem !important;
    margin: 1.5rem 0 !important;
}
.amanat-btn {
    padding: 0.5rem 1rem;
    background: #eef2fb !important;
    color: #1b3a7a !important;
    border: none !important;
    border-radius: 9px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.amanat-btn:hover:not(:disabled) { background: #1e5ef3 !important; color: #fff !important; }
.amanat-btn:disabled { opacity: 0.45; cursor: not-allowed; }

h1, h2, h3, h4 { font-family: inherit; color: #1b3a7a; }

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    font-size: 0.92rem;
}

/* ===================== RESPONSIVE ===================== */
@media screen and (max-width: 991px) {
    .app-sidebar { transform: translateX(100%); }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .app-main { margin-right: 0; }
    .topbar-company { display: none; }
    .app-content { padding: 1rem; }
    .cards { grid-template-columns: 1fr !important; }
}

@media screen and (max-width: 576px) {
    #dashboard .card .amount { font-size: 1.05rem; }
    #login { margin: 1rem; padding: 1.6rem 1.2rem; }
}
