@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

/* ========================================================================== 
   Core Layout and Shared Helpers
   ========================================================================== */
:root {
    --font-primary: "Poppins", sans-serif;
    --font-secondary: "Manrope", "Poppins", sans-serif;

    --color-base: #2ecc71;
    --color-dark: #000036;

    --brand-primary: var(--color-base);
    --brand-primary-hover: #29b765;
    --brand-warning: #ff9f43;
    --brand-warning-hover: #ff922a;
    --brand-danger: #ea5455;
    --brand-danger-hover: #e73d3e;
    --brand-dark: var(--color-dark);
    --brand-dark-hover: #00002a;

    --text-heading: var(--color-dark);
    --text-body: #5b6e88;
    --line-soft: #dde4f0;
    --surface-card: #ffffff;

    --drive-ink: var(--color-dark);
    --drive-muted: #33446e;
    --drive-bg: #f3f5fb;
    --drive-line: #dae4ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    color: var(--text-body);
    background-color: #f7f9fc;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--text-heading);
}

a {
    text-decoration: none;
}

.page-wrapper {
    min-height: 100vh;
}

.body-wrapper {
    padding: 30px;
}

@media (max-width: 575px) {
    .body-wrapper {
        padding: 30px 10px;
    }
}

.bodywrapper__inner {
    width: 100%;
}

.page-title {
    font-size: 1.125rem;
    display: inline-block;
}

.custom-container {
    width: 100%;
    max-width: 1140px;
}

.bg--dark {
    background-color: var(--color-dark) !important;
}

.text--primary {
    color: var(--brand-primary) !important;
}

.text--danger {
    color: var(--brand-danger) !important;
}

.box--shadow1 {
    box-shadow: 0 5px 26px -5px #cdd4e7 !important;
}

.b-radius--10 {
    border-radius: 10px !important;
}

.card {
    border-radius: 12px;
    overflow: hidden;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-50 {
    margin-bottom: 50px;
}

.mt-30 {
    margin-top: 30px;
}

.h-45 {
    height: 45px;
}

a.btn.h-45 {
    line-height: 27.5px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

label.required::after {
    content: "*";
    color: #dc3545 !important;
    margin-left: 2px;
}

.modal .close {
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 1rem;
}

.user-editor-modal .modal-dialog {
    max-width: 620px;
}

.user-editor-modal .modal-content {
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(9, 16, 48, 0.22);
}

.user-editor-modal .modal-header {
    border-bottom: 1px solid #e7edf6;
    padding: 18px 22px;
}

.user-editor-modal .modal-title {
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-editor-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    background-color: rgba(46, 204, 113, 0.14);
    font-size: 0.9rem;
}

.user-editor-modal .modal-body {
    padding: 22px;
}

.user-editor-modal .form-label {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-heading);
}

.user-editor-modal .form-control {
    height: 45px;
}

.user-editor-modal .form-text {
    color: #6d7587 !important;
}

.user-editor-modal .modal-footer {
    border-top: 1px solid #e7edf6;
    padding: 16px 22px;
    gap: 10px;
}

.user-editor-modal .btn-close {
    box-shadow: none;
}

/* ========================================================================== 
   Navbar and Dropdown
   ========================================================================== */
.navbar-wrapper {
    position: relative;
    background: #ffffff;
    padding: 15px 30px;
    border-bottom: 1px solid #dee4ec;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 575px) {
    .navbar-wrapper {
        padding: 10px;
    }
}

.navbar__left,
.navbar__right,
.navbar__action-list,
.navbar-user {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.navbar__right {
    margin-left: auto;
}

.navbar__right button {
    background-color: transparent;
    border: 0;
    padding: 0;
}

.navbar__right button i {
    color: #5b6e88;
    font-size: 1.5rem;
    text-shadow: 1px 2px 5px rgba(0, 0, 0, 0.15);
}

.navbar-user__thumb {
    width: 35px;
}

.navbar-user__thumb img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-user__info {
    padding-left: 10px;
}

.navbar-user__name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #34495e;
}

.navbar-user .icon {
    padding-left: 10px;
}

.navbar-user .icon i {
    font-size: 0.875rem;
}

.navbar__action-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar__action-list li {
    margin-right: 15px;
}

.navbar__action-list li:last-child {
    margin-right: 0;
}

@media (max-width: 575px) {
    .navbar-user__info,
    .navbar-user .icon {
        display: none;
    }

    .navbar__action-list li {
        margin-right: 5px;
    }
}

.dropdown-menu.dropdown-menu--sm {
    min-width: 12rem;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-menu__item {
    display: block;
    border-bottom: 1px solid #e5e5e5;
}

.dropdown-menu__item:last-child {
    border-bottom: 0;
}

.dropdown-menu__item:hover {
    background-color: #f7f7f7;
}

.dropdown-menu__icon {
    font-size: 1.25rem;
    color: #34495e;
}

.dropdown-menu__caption {
    color: #34495e;
    font-size: 0.875rem;
    font-weight: 500;
}

.dropdown-menu__icon ~ .dropdown-menu__caption {
    padding-left: 8px;
}

/* ========================================================================== 
   Buttons and Badges
   ========================================================================== */
.btn[class*="btn--"],
.btn[class*="btn-outline--"] {
    transition: all 0.2s ease;
}

.btn--primary {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

.btn--primary:hover {
    background-color: var(--brand-primary-hover) !important;
    color: #ffffff !important;
}

.btn--warning {
    background-color: var(--brand-warning) !important;
    color: #ffffff !important;
}

.btn--warning:hover {
    background-color: var(--brand-warning-hover) !important;
    color: #ffffff !important;
}

.btn--danger {
    background-color: var(--brand-danger) !important;
    color: #ffffff !important;
}

.btn--danger:hover {
    background-color: var(--brand-danger-hover) !important;
    color: #ffffff !important;
}

.btn--dark {
    background-color: var(--brand-dark) !important;
    color: #ffffff !important;
}

.btn--dark:hover {
    background-color: var(--brand-dark-hover) !important;
    color: #ffffff !important;
}

.btn-outline--primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary) !important;
}

.btn-outline--primary:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
}

.btn-outline--success {
    color: #28c76f;
    border-color: #28c76f !important;
}

.btn-outline--success:hover {
    background-color: #28c76f;
    color: #ffffff;
}

.btn-outline--warning {
    color: var(--brand-warning);
    border-color: var(--brand-warning) !important;
}

.btn-outline--warning:hover {
    background-color: var(--brand-warning);
    color: #ffffff;
}

.btn-outline--dark {
    color: var(--brand-dark);
    border-color: #b7c4dd !important;
}

.btn-outline--dark:hover {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark) !important;
    color: #ffffff;
}

.badge {
    font-size: 0.75rem !important;
    font-weight: 500;
}

.badge--primary,
.badge--warning,
.badge--success,
.badge--danger,
.badge--dark {
    padding: 2px 12px;
    border-radius: 999px;
}

.badge--primary {
    background-color: rgba(115, 103, 240, 0.1);
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
}

.badge--warning {
    background-color: rgba(255, 159, 67, 0.1);
    border: 1px solid var(--brand-warning);
    color: var(--brand-warning);
}

.badge--success {
    background-color: rgba(40, 199, 111, 0.1);
    border: 1px solid #28c76f;
    color: #28c76f;
}

.badge--danger {
    background-color: rgba(234, 84, 85, 0.1);
    border: 1px solid var(--brand-danger);
    color: var(--brand-danger);
}

.badge--dark {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid #000000;
    color: #000000;
}

/* ========================================================================== 
   Forms, Tables, and Pagination
   ========================================================================== */
input.form-control,
select.form-control {
    height: 45px;
}

.form-control:focus,
.form-control:active,
textarea:focus,
select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 3px 9px rgba(50, 50, 9, 0.05), 3px 4px 8px rgba(115, 103, 240, 0.1);
}

.table > :not(caption) > * > * {
    border-bottom-width: 0;
}

table.table--light thead th {
    border: none;
    color: #ffffff;
    background-color: var(--brand-primary);
}

table.table--light.style--two {
    border-collapse: separate;
    border-spacing: 0;
}

table.table--light.style--two thead th {
    border-top: none;
    padding-left: 25px;
    padding-right: 25px;
}

table.table--light.style--two thead th:first-child {
    border-top-left-radius: 8px;
}

table.table--light.style--two thead th:last-child {
    border-top-right-radius: 8px;
}

table.table--light.style--two tbody td {
    padding: 15px 25px;
}

table.table--light.style--two thead th:last-child,
table.table--light.style--two tbody td:last-child {
    text-align: right;
}

table.table--light.style--two tbody tr:not(:last-child) td {
    border-bottom: 1px solid #d9e2ef;
}

table.table--light.style--two.table-hover > tbody > tr:hover:not(:last-child) > td {
    border-bottom-color: #bfe8d0;
}

.table-responsive {
    border-radius: inherit;
}

.activity-log-table tbody td {
    vertical-align: middle;
}

.activity-log-table.table-hover > tbody > tr:hover > * {
    background-color: #f4fbf7;
}

.activity-log-table .activity-main {
    font-weight: 600;
    color: #151a28;
    line-height: 1.35;
}

.activity-log-table .activity-sub {
    color: #5f6676;
    font-size: 0.875rem;
}

.activity-log-table .activity-user-link {
    color: #4f5d75;
}

.activity-log-table .activity-user-link:hover {
    color: var(--brand-primary);
}

.activity-log-table .activity-path {
    max-width: 440px;
    overflow-wrap: anywhere;
}

.login-log-table tbody td {
    vertical-align: middle;
}

.login-log-table.table-hover > tbody > tr:hover > * {
    background-color: #f4fbf7;
}

.login-log-table .log-main {
    font-weight: 600;
    color: #151a28;
    line-height: 1.35;
}

.login-log-table .log-sub {
    color: #5f6676;
    font-size: 0.875rem;
}

.login-log-table .log-user-link {
    color: #4f5d75;
}

.login-log-table .log-user-link:hover {
    color: var(--brand-primary);
}

.login-log-table .log-location {
    max-width: 300px;
    overflow-wrap: anywhere;
}

.user-list-table tbody td {
    vertical-align: middle;
}

.user-list-table.table-hover > tbody > tr:hover > * {
    background-color: #f4fbf7;
}

.user-list-table .user-main {
    font-weight: 600;
    color: #151a28;
    line-height: 1.35;
}

.user-list-table .user-sub {
    color: #5f6676;
    font-size: 0.875rem;
}

.user-list-table .user-action-cell {
    white-space: nowrap;
}

[data-label] {
    position: relative;
}

[data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    font-weight: 700;
    color: #000000;
    padding: 13px 15px;
}

@media (max-width: 991px) {
    .table-responsive--md table.table--light.style--two tbody tr td {
        border-bottom: 0;
    }

    .table-responsive--md thead {
        display: none;
    }

    .table-responsive--md tbody tr:nth-child(odd) {
        background-color: #e2e2e233;
    }

    .table-responsive--md tbody tr:nth-child(odd) td {
        border-top: 1px solid #10163a17;
    }

    .table-responsive--md tr th,
    .table-responsive--md tr td {
        display: block;
        text-align: right !important;
        padding-left: 45% !important;
    }

    .table-responsive--md [data-label]::before {
        display: block;
    }
}

@media (max-width: 767px) {
    .table-responsive--sm table.table--light.style--two tbody tr td {
        border-bottom: 0;
    }

    .table-responsive--sm thead {
        display: none;
    }

    .table-responsive--sm tbody tr:nth-child(odd) {
        background-color: #e2e2e233;
    }

    .table-responsive--sm tbody tr:nth-child(odd) td {
        border-top: 1px solid #10163a17;
    }

    .table-responsive--sm tr th,
    .table-responsive--sm tr td {
        display: block;
        text-align: right !important;
        padding-left: 45% !important;
    }

    .table-responsive--sm [data-label]::before {
        display: block;
    }
}

.pagination {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination .page-item .page-link,
.pagination .page-item span {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50% !important;
    color: var(--text-body);
    font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* ========================================================================== 
   Login Page
   ========================================================================== */
.login-main {
    min-height: 100vh;
    padding: 100px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-color: #3d2bfb;
}

.login-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #000036;
    opacity: 0.9;
    z-index: -1;
}

/* ==========================================================================
   Settings Page
   ========================================================================== */
.settings-page__intro {
    margin-bottom: 2px;
}

.settings-page__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.settings-page__lead {
    margin-bottom: 0;
    color: #5f6676;
    font-size: 0.95rem;
}

.settings-card {
    border: 1px solid #dbe3ef;
    box-shadow: 0 8px 20px rgba(16, 22, 58, 0.04);
}

.settings-card .card-body {
    display: flex;
    flex-direction: column;
}

.settings-card__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #e6edf6;
    margin-bottom: 22px;
    padding-bottom: 14px;
}

.settings-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    background-color: rgba(46, 204, 113, 0.14);
    font-size: 1rem;
    flex-shrink: 0;
}

.settings-card__text {
    color: #5f6676;
    font-size: 0.9rem;
}

.settings-form .form-label {
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 7px;
}

.settings-form .form-control {
    height: 46px;
    border-color: #d6deeb;
    background-color: #ffffff;
}

.settings-form .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

.settings-form .btn {
    font-weight: 600;
    letter-spacing: 0.2px;
}

@media (max-width: 575px) {
    .login-main {
        padding: 50px 0;
    }
}

.login-area {
    position: relative;
}

.login-wrapper {
    background-color: #000036;
    border-radius: 10px;
    overflow: hidden;
}

.login-wrapper__top {
    padding: 30px 30px 0;
    text-align: center;
}

.login-wrapper__top .title {
    font-size: 30px;
    font-weight: 600;
}

@media (max-width: 575px) {
    .login-wrapper__top {
        padding: 40px 15px;
    }

    .login-wrapper__top .title {
        font-size: 24px;
    }
}

.login-wrapper__body {
    padding: 40px;
}

@media (max-width: 575px) {
    .login-wrapper__body {
        padding: 30px 20px;
    }
}

.login-form .form-control {
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 16px;
    padding: 20px;
    background-color: transparent;
}

.login-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.31) !important;
}

.login-form .form-control:focus {
    background-color: transparent;
    border-color: #3d2bfb;
}

.cmn-btn {
    background-color: #3d2bfb;
    color: #ffffff;
    height: 50px;
}

.cmn-btn:hover {
    color: #ffffff;
}

/* ========================================================================== 
   File Manager Page
   ========================================================================== */
body.file-manager-page {
    background: var(--drive-bg);
    color: var(--drive-ink);
    font-family: var(--font-secondary);
}

body.file-manager-page .navbar-wrapper {
    background: var(--color-dark) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

body.file-manager-page .navbar-user__name,
body.file-manager-page .navbar__right button i {
    color: #ffffff;
}

body.file-manager-page .bodywrapper__inner {
    padding-top: 18px;
}

body.file-manager-page .page-title {
    color: var(--drive-muted) !important;
    font-family: var(--font-secondary);
    font-weight: 700;
}

body.file-manager-page .breadcrumb-inline-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.file-manager-page .breadcrumb-inline-wrap .page-title {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    padding: 3px 6px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

body.file-manager-page .breadcrumb-inline-wrap .page-title:hover {
    background: #e9f9f0;
    color: var(--color-dark) !important;
}

body.file-manager-page .breadcrumb-inline-wrap .page-title:focus-visible {
    outline: 2px solid rgba(46, 204, 113, 0.55);
    outline-offset: 1px;
    background: #e9f9f0;
}

body.file-manager-page .breadcrumb-stats {
    margin-left: 6px;
}

body.file-manager-page .bodywrapper__inner > .d-flex.mb-30.flex-wrap {
    background: #ffffff;
    border: 1px solid var(--drive-line);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px !important;
}

.drive-shell {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.workspace-controls {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-sort-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select {
    min-width: 205px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #cdd7ee;
    background: #f8faff;
    color: #21356d;
    font-size: 13px;
    font-weight: 600;
    padding: 0 14px;
    outline: 0;
}

.sort-select:focus {
    border-color: #8da4e0;
    box-shadow: 0 0 0 2px rgba(96, 129, 217, 0.18);
}

.stat-chip {
    min-width: 72px;
    height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--drive-line);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3f538d;
}

.stat-chip-combined {
    padding: 0 8px;
    gap: 0;
}

.stat-chip-item {
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.stat-chip-divider {
    width: 1px;
    height: 18px;
    background: #d8e0f4;
}

.stat-chip-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    color: var(--drive-ink);
}

.drive-grid .card {
    border: 0;
    border-radius: 7px;
    overflow: hidden;
    min-height: 292px;
    position: relative;
    transform: translateY(10px);
    opacity: 0;
    animation: cardIn 0.55s ease forwards;
}

.drive-grid > div:nth-child(2n) .card {
    animation-delay: 0.04s;
}

.drive-grid > div:nth-child(3n) .card {
    animation-delay: 0.08s;
}

.drive-grid > div:nth-child(4n) .card {
    animation-delay: 0.12s;
}

.folder-card {
    min-height: 146px !important;
    background: #f0bf40;
    border: 1px solid #e5b43a;
    color: #3d2600;
}

.file-card {
    background: #ffffff;
    color: #14204f;
    border: 1px solid #dfe6f4;
    box-shadow: 0 6px 16px rgba(21, 38, 89, 0.05);
}

.file-card .card-body {
    height: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.folder-link {
    height: 100%;
    color: #2b1a00;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.folder-top,
.file-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.folder-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.26);
    color: #593400;
    font-size: 20px;
}

.entry-tag {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.25);
}

.foldername {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #2b1a00;
}

.foldername .text {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1b4ec3;
}

.foldername .icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.26s ease;
}

.folder-link:hover {
    background: rgba(255, 255, 255, 0.07);
}

.folder-link:hover .foldername .icon {
    opacity: 1;
    transform: translateX(0);
}

.file-head {
    margin-bottom: 6px;
    min-height: 24px;
}

.file-title-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.file-type-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #dde5f5;
    background: #eff3fb;
    color: #51659a;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filename {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    color: #1a2d5c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview {
    flex: 0 0 194px;
    height: 194px;
    border-radius: 5px;
    border: 1px solid #e1e7f3;
    background: #f9fbff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
    overflow: hidden;
}

.preview-open {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    position: relative;
    display: block;
    cursor: zoom-in;
}

.file-thumb,
.pdf-thumb-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    pointer-events: none;
}

.file-thumb {
    object-fit: cover;
}

.pdf-thumb-canvas {
    background: #ffffff;
    object-fit: cover;
}

.file-name-bg {
    font-size: 58px;
    line-height: 1.2;
    color: rgba(68, 79, 117, 0.28);
}

.preview-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    display: grid;
    place-items: center;
    background: rgba(16, 30, 67, 0.4);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.preview-overlay span {
    padding: 6px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: #162a5f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.preview-open:hover .preview-overlay {
    opacity: 1;
}

.file-meta {
    min-height: 26px;
    padding-top: 4px;
    border-top: 1px solid #eaf0fb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.file-info-badge {
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid #dce5f8;
    background: #edf2fc;
    color: #30477f;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.1;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: 1px solid #dbe4f5;
    background: #f4f7fd;
    color: #36508c;
    font-size: 13px;
    text-decoration: none;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: #e7eefb;
    border-color: #c8d5ef;
    color: #1b376f;
}

.file-actions .delete-btn {
    border-color: #f4d2da;
    background: #fbeef1;
    color: #b33753;
}

.file-actions .delete-btn:hover {
    background: #f8e2e8;
    border-color: #efc1cd;
    color: #9b2340;
}

.drive-grid .card:hover,
.file-card:hover {
    transform: translateY(-4px);
}

.file-card:hover {
    border-color: #c8d4ed;
    box-shadow: 0 14px 28px rgba(22, 42, 96, 0.1);
}

body.file-manager-page .modal-content {
    border-radius: 8px;
}

.file-preview-modal.modal {
    min-height: 0 !important;
}

.file-preview-modal .modal-content {
    border-radius: 7px;
    border: 1px solid #1f2b57;
    background: #11192f;
    color: #ffffff;
    max-height: calc(100vh - 4rem);
    overflow: hidden;
}

.file-preview-modal .modal-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.file-preview-modal .modal-title {
    color: #f4f7ff;
    font-size: 24px;
    font-weight: 700;
}

.preview-modal-title {
    font-size: inherit;
}

.file-preview-modal .close {
    color: #ffffff;
}

.preview-modal-dialog {
    max-width: min(86vw, 980px);
    margin: 2rem auto;
}

.file-preview-modal .modal-body {
    max-height: calc(100vh - 170px);
    overflow: auto;
    padding: 8px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.file-manager-page.modal-open {
    padding-right: 0 !important;
}

.modal-preview-image,
.modal-preview-pdf {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 5px;
    background: #ffffff;
}

.modal-preview-image {
    height: auto;
    max-height: none;
    margin: 0 auto;
    object-fit: contain;
    background: #0d1631;
}

.file-preview-modal.preview-pdf-mode .modal-preview-pdf {
    min-height: 56vh;
}

.file-preview-modal.preview-image-mode .modal-body,
.file-preview-modal.preview-pdf-mode .modal-body {
    display: block;
}

/* Upload modal polish to match theme colors */
body.file-manager-page #addFileModal .modal-dialog {
    max-width: 620px;
}

body.file-manager-page #addFileModal .modal-content {
    border: 1px solid rgba(0, 0, 54, 0.14);
    border-radius: 12px;
    overflow: hidden;
}

body.file-manager-page #addFileModal .modal-header {
    padding: 16px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fff9 100%);
    border-bottom: 1px solid rgba(0, 0, 54, 0.1);
}

body.file-manager-page #addFileModal .modal-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-dark);
    font-family: var(--font-secondary);
    font-size: 1.05rem;
    font-weight: 800;
}

body.file-manager-page #addFileModal .upload-modal-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.16);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

body.file-manager-page #addFileModal .btn-close {
    box-shadow: none;
}

body.file-manager-page #addFileModal .modal-body {
    padding: 18px;
    background: #f9fcff;
}

body.file-manager-page #addFileModal .upload-modal-subtitle {
    margin: 0 0 14px;
    color: #4d608d;
    font-size: 13px;
    line-height: 1.45;
}

body.file-manager-page #addFileModal .modal-footer {
    padding: 14px 18px 18px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 54, 0.08);
    gap: 10px;
}

body.file-manager-page #addFileModal .modal-footer .btn {
    min-width: 130px;
}

/* Folder create modal polish to improve hierarchy and readability */
body.file-manager-page #addFolderModal .modal-dialog {
    max-width: 520px;
}

body.file-manager-page #addFolderModal .modal-content {
    border: 1px solid rgba(0, 0, 54, 0.14);
    border-radius: 12px;
    overflow: hidden;
}

body.file-manager-page #addFolderModal .modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 54, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #f4fff8 100%);
}

body.file-manager-page #addFolderModal .modal-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-dark);
    font-family: var(--font-secondary);
    font-size: 1.05rem;
    font-weight: 800;
}

body.file-manager-page #addFolderModal .folder-create-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(46, 204, 113, 0.16);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

body.file-manager-page #addFolderModal .btn-close {
    box-shadow: none;
}

body.file-manager-page #addFolderModal .modal-body {
    padding: 18px;
    background: #f9fcff;
}

body.file-manager-page #addFolderModal .folder-create-subtitle {
    margin: 0 0 14px;
    color: #4d608d;
    font-size: 13px;
    line-height: 1.45;
}

body.file-manager-page #addFolderModal .form-label {
    margin-bottom: 6px;
    color: var(--color-dark);
    font-size: 13px;
    font-weight: 700;
}

body.file-manager-page #addFolderModal .form-control {
    height: 46px;
    border: 1px solid #cfdbf3;
    border-radius: 8px;
    font-size: 14px;
    color: #24345f;
    box-shadow: none;
}

body.file-manager-page #addFolderModal .form-control::placeholder {
    color: #8c9fc3;
}

body.file-manager-page #addFolderModal .form-control:focus {
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18);
}

body.file-manager-page #addFolderModal .folder-create-help {
    display: block;
    margin-top: 6px;
    color: #5f739b;
    font-size: 11.5px;
}

body.file-manager-page #addFolderModal .modal-footer {
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(0, 0, 54, 0.08);
    background: #ffffff;
    gap: 10px;
}

body.file-manager-page #addFolderModal .modal-footer .btn {
    min-width: 130px;
}

.upload-dropzone {
    width: 100%;
    min-height: 124px;
    margin-top: 4px;
    padding: 16px;
    border: 2px dashed rgba(46, 204, 113, 0.62);
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-active {
    border-color: var(--color-base);
    background: #f2fff8;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18);
}

.upload-dropzone-input {
    display: none;
}

.upload-dropzone-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex: 0 0 auto;
    background: rgba(46, 204, 113, 0.16);
    color: var(--color-base);
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-dropzone-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.upload-dropzone-text {
    display: block;
    color: var(--color-dark);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.upload-dropzone-link {
    color: #1ea95b;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-dropzone-meta {
    display: block;
    margin-top: 6px;
    color: #506089;
    font-size: 12.5px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-dropzone-hint {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #d4dff5;
    background: #eef3ff;
    color: #385189;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.upload-selected-wrap {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d8e3f8;
    border-radius: 8px;
    background: #ffffff;
}

.upload-selected-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.upload-selected-title {
    color: var(--color-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.upload-selected-count {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(46, 204, 113, 0.16);
    color: #0f8b49;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upload-selected-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.upload-selected-item {
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #d7e3f8;
    background: #f4f8ff;
    color: #2f467c;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-selected-item.more {
    background: #eefaf2;
    border-color: #cdebd8;
    color: #137344;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    body.file-manager-page .bodywrapper__inner {
        padding-top: 14px;
    }

    body.file-manager-page .bodywrapper__inner > .d-flex.mb-30.flex-wrap {
        padding: 10px;
        margin-bottom: 14px !important;
    }

    .workspace-controls {
        justify-content: flex-start;
    }

    body.file-manager-page .breadcrumb-stats {
        width: 100%;
        margin-left: 0;
    }

    .toolbar-sort-form {
        width: 100%;
        order: 3;
        margin-left: 0;
    }

    .workspace-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .sort-select {
        min-width: 100%;
    }

    .drive-grid .card {
        min-height: 252px;
    }

    .file-preview {
        flex-basis: 162px;
        height: 162px;
    }

    .folder-card {
        min-height: 128px !important;
    }

    body.file-manager-page #addFileModal .modal-footer .btn {
        min-width: 0;
        flex: 1 1 0;
    }

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

    .upload-dropzone-hint {
        margin-left: 52px;
    }
}
