/* =========================================================
   Pharmacy Accounting ERP - PRO++ Enterprise UI
   Bootstrap Friendly Custom CSS
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family:
        Inter,
        Segoe UI,
        Tahoma,
        sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

/* =========================================================
   Layout
========================================================= */

.container {
    width: 100%;
    padding: 24px;
}

/* =========================================================
   Navbar
========================================================= */

.navbar {
    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e293b,
            #1e3a8a
        );

    color: #ffffff;

    padding: 16px 28px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    position: sticky;
    top: 0;
    z-index: 999;

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.25);
}

.brand {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    opacity: 0.9;
    transition: 0.2s ease;
}

.nav-links a:hover {
    opacity: 1;
    color: #93c5fd;
}

/* =========================================================
   Page Header
========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
    color: #0f172a;
}

.page-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 15px;
}

/* =========================================================
   Dashboard Cards
========================================================= */

.grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.card {
    background: #ffffff;

    border-radius: 24px;

    padding: 24px;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.08);

    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.12);
}

.card h3 {
    margin: 0 0 14px;
    color: #475569;
    font-size: 15px;
}

.card strong {
    font-size: 38px;
    font-weight: 900;
    color: #1e3a8a;
}

/* =========================================================
   Buttons
========================================================= */

button,
.btn {
    border: 0;
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #1d4ed8,
            #1e40af
        );

    color: #ffffff;

    padding: 13px 20px;

    font-weight: 800;
    font-size: 14px;

    cursor: pointer;

    transition: 0.25s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(30, 64, 175, 0.28);
}

/* =========================================================
   Forms
========================================================= */

form {
    width: 100%;
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;

    font-weight: 700;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;

    border:
        1px solid #cbd5e1;

    border-radius: 14px;

    padding: 14px;

    background: #ffffff;

    font-size: 14px;

    transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

/* =========================================================
   Tables
========================================================= */

table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;

    border-radius: 22px;

    overflow: hidden;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.08);
}

thead {
    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e293b
        );

    color: #ffffff;
}

th,
td {
    padding: 16px;
    border-bottom:
        1px solid #e2e8f0;

    text-align: left;
}

tbody tr:hover {
    background: #f8fafc;
}

/* =========================================================
   Modal
========================================================= */

.modal {
    display: none;

    position: fixed;
    inset: 0;

    background:
        rgba(15, 23, 42, 0.65);

    z-index: 9999;

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.modal-box {
    width: 100%;
    max-width: 560px;

    background: #ffffff;

    border-radius: 24px;

    padding: 24px;

    box-shadow:
        0 30px 80px rgba(0,0,0,0.35);

    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-header button {
    background: #e2e8f0;
    color: #0f172a;
    padding: 8px 14px;
}

/* =========================================================
   Login Page
========================================================= */

.login-page {
    min-height: 100vh;

    display: grid;
    place-items: center;

    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e3a8a
        );
}

.login-card {
    width: 100%;
    max-width: 440px;

    background: #ffffff;

    border-radius: 28px;

    padding: 34px;

    box-shadow:
        0 40px 100px rgba(0,0,0,0.35);
}

.login-card h1 {
    margin: 0;
    color: #1e3a8a;
    font-size: 34px;
}

.login-card p {
    color: #64748b;
}

/* =========================================================
   Alerts
========================================================= */

.alert {
    margin-top: 18px;

    border-radius: 14px;

    padding: 14px;

    font-weight: 700;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* =========================================================
   Tree View
========================================================= */

.tree-card {
    background: #ffffff;

    border-radius: 24px;

    padding: 18px;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.08);

    overflow-x: auto;
}

.account-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.account-tree li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 16px;

    padding: 12px 16px;

    border-radius: 14px;

    margin-bottom: 8px;

    border:
        1px solid #e2e8f0;

    transition: 0.2s ease;
}

.tree-row:hover {
    background: #f8fafc;
}

.tree-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tree-indent {
    display: inline-flex;
}

.tree-indent-step {
    width: 24px;
    display: inline-block;
}

.tree-icon {
    font-weight: 900;
    color: #2563eb;
    font-size: 16px;
}

.tree-code {
    min-width: 90px;

    font-weight: 900;

    color: #0f172a;
}

.tree-name {
    font-weight: 700;
    color: #334155;
}

.tree-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 900;

    text-transform: uppercase;
}

.type-asset {
    background: #dcfce7;
    color: #166534;
}

.type-liability {
    background: #fee2e2;
    color: #991b1b;
}

.type-equity {
    background: #ede9fe;
    color: #5b21b6;
}

.type-income {
    background: #dbeafe;
    color: #1e40af;
}

.type-expense {
    background: #ffedd5;
    color: #9a3412;
}

.postable {
    background: #ffffff;
}

.header-account {
    background: #f8fafc;
}

.empty-tree {
    text-align: center;
    padding: 50px;
    color: #64748b;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 992px) {

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tree-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .tree-meta {
        width: 100%;
    }
}

@media (max-width: 768px) {

    .container {
        padding: 16px;
    }

    .card strong {
        font-size: 30px;
    }

    .modal-box {
        padding: 18px;
    }

    th,
    td {
        padding: 12px;
    }
}