:root {
    --bg: #131a26;
    --bg-deep: #0f1724;
    --card: rgba(248, 251, 255, 0.94);
    --card-strong: rgba(255, 255, 255, 0.98);
    --text: #141d2a;
    --muted: #6f7f97;
    --line: rgba(35, 56, 86, 0.10);
    --grad-a: #1c232d;
    --grad-b: #1c232d;
    --grad-c: #1c232d;
    --accent-soft: #c9c9c9;
    --accent-ice: #eef5fc;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: #131a26 url(bgp.png) top;
    min-height: 100vh;
}

a { color: #353739; }
a:hover { color: #353739; }

.app-shell { min-height: 100vh; }
.glass-nav {
    background: rgba(18, 27, 41, .78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.navbar .navbar-brand,
.navbar .nav-link,
.glass-nav .text-muted,
.glass-nav .navbar-text {
    color: #e8f0fb !important;
}
.brand-orb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-c));
    box-shadow: 0 0 20px rgba(111, 164, 223, .45);
}

.hero-card, .panel-card, .stat-card, .auth-card {
    border-radius: 28px;
    box-shadow: 0 18px 60px rgba(7, 18, 33, .22);
}

.hero-card {
    min-height: 420px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.20), rgba(255,255,255,.05)),
        linear-gradient(135deg, #4f77c2, #6ea6de 58%, #93c6eb);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card, .panel-card, .stat-card {
    background: linear-gradient(180deg, rgba(250, 252, 255, .97), rgba(241, 247, 253, .94));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(221, 232, 245, .85);
}

.auth-wrap { padding-top: 2rem; padding-bottom: 2rem; }

.icon-bubble {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-c));
}

.form-label,
.panel-title,
.stat-value,
.fw-bold,
.table,
.modal-title,
label,
.small,
.text-dark {
    color: var(--text);
}

.form-control, .form-select {
    min-height: 52px;
    border: 1px solid #d8e4f1;
    background: var(--accent-ice);
    color: var(--text);
}

.form-control::placeholder { color: #7b8ba3; }

.form-control:focus, .form-select:focus {
    border-color: #74a7de;
    box-shadow: 0 0 0 .2rem rgba(116, 167, 222, .18);
    background: #f7fbff;
}

.stat-card { padding: 1.5rem; }
.stat-label {
    font-size: .92rem;
    color: #838383;
    margin-bottom: .25rem;
    font-weight: 700;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
}
.stat-value.smallish { font-size: 1.4rem; }

.accent-card {
    background: linear-gradient(180deg, rgba(250, 252, 255, .97), rgba(241, 247, 253, .94));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(221, 232, 245, .85);
}
.accent-card .stat-label,
.accent-card .text-white-50 {
    color: rgba(255,255,255,.88) !important;
}
.accent-card .form-control {
    background: rgba(255,255,255,.92);
    color: #22344d;
}

.panel-card { padding: 1.5rem; }
.panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.text-secondary,
.small.text-secondary,
.form-text {
    color: var(--muted) !important;
}

.folder-list { display: flex; flex-wrap: wrap; gap: .75rem; }
.folder-pill {
    text-decoration: none;
    color: #141d2a;
    background: var(--accent-soft);
    padding: .65rem .95rem;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid #d4e1ef;
}
.folder-pill.active {
    background: linear-gradient(135deg, var(--grad-a), var(--grad-c));
    color: #fff;
    border-color: transparent;
}

.progress-soft {
    height: 18px;
    border-radius: 999px;
    background: #e8f0f8;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(135deg, #5f86c9, #8cc0ea);
}

.modern-table thead th {
    color: #6f84a1;
    font-size: .85rem;
    border-bottom: 1px solid #e4edf6;
}
.modern-table tbody td { border-bottom: 1px solid #edf3f8; }
.table > :not(caption) > * > * { background: transparent; color: var(--text); }

.btn { border-width: 0; }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-c));
}
.btn-primary:hover { filter: brightness(.97); color: #fff; }
.btn-light {
    background: #f7fbff;
    color: var(--text);
}
.btn-outline-primary {
    border: 1px solid #9ebfe4;
    color: #4775b9;
    background: rgba(255,255,255,.55);
}
.btn-outline-primary:hover {
    background: #e7f0fa;
    color: #315c99;
}
.btn-warning {
    background: #f1c86d;
    color: #493718;
}
.btn-info {
    background: #68a9d7;
}
.btn-success {
    background: #6eb79f;
}

.modal-content {
    background: var(--card-strong);
    color: var(--text);
    border: 1px solid #dce8f4;
}
.modal-backdrop.show { opacity: .45; }

.dropzone,
.file-chip,
.empty-files-state {
    background: #f6faff;
    border-color: #dbe7f3;
    color: var(--text);
}

@media (max-width: 991px) {
    .stat-value { font-size: 1.5rem; }
}




/* Modal behavior kept close to Bootstrap to avoid clipping or blocked inputs */
.modal-backdrop.show {
    opacity: .38;
}

.modal-content {
    background: #f7fbff;
    border: 1px solid rgba(173, 201, 255, 0.45);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.modal-content .form-control,
.modal-content .form-select {
    background: #eef5ff;
    border: 1px solid #c9daf7;
    color: #142033;
}

.dashboard-files-wrap,
.folders-table-wrap {
    overflow: visible;
}


/* ===== Tabla de archivos premium ===== */
.dashboard-files-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.10));
    border: 1px solid rgba(188, 208, 232, .55);
    border-radius: 24px;
    padding: 14px 16px 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.modern-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.modern-table thead th {
    background: linear-gradient(180deg, rgba(104, 145, 196, .14), rgba(104, 145, 196, .06));
    color: #838383;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    border: 0;
    padding: 14px 16px;
    vertical-align: middle;
}

.modern-table thead th:first-child {
    border-radius: 16px 0 0 16px;
}

.modern-table thead th:last-child {
    border-radius: 0 16px 16px 0;
}

.modern-table tbody tr {
    filter: drop-shadow(0 8px 18px rgba(12, 28, 52, .08));
}

.modern-table tbody td {
    background: linear-gradient(180deg, rgba(251, 253, 255, .98), rgba(241, 247, 253, .96));
    border-top: 1px solid rgba(205, 220, 239, .8);
    border-bottom: 1px solid rgba(205, 220, 239, .8);
    border-left: 0;
    border-right: 0;
    padding: 16px;
    vertical-align: middle;
}

.modern-table tbody td:first-child {
    border-left: 1px solid rgba(205, 220, 239, .8);
    border-radius: 18px 0 0 18px;
    min-width: 270px;
}

.modern-table tbody td:last-child {
    border-right: 1px solid rgba(205, 220, 239, .8);
    border-radius: 0 18px 18px 0;
}

.modern-table tbody tr:hover td {
    background: linear-gradient(180deg, rgba(255,255,255,1), rgba(246, 250, 255, 1));
    border-color: rgba(150, 184, 225, .95);
}

.modern-table tbody tr:hover .file-name-main {
    color: #1f3556;
}

.modern-table .file-name-main {
    display: inline-block;
    font-size: 1.08rem;
    font-weight: 800;
    color: #243954;
    margin-bottom: 2px;
}

.modern-table .file-name-sub {
    display: inline-block;
    font-size: .92rem;
    color: #7c8fa8 !important;
}

.modern-table .folder-badge,
.modern-table .size-badge,
.modern-table .date-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 700;
    background: #eef5fd;
    border: 1px solid #d7e5f3;
    color: #35506f;
    white-space: nowrap;
}

.modern-table .folder-badge {
    background: linear-gradient(180deg, #edf4ff, #e5eefb);
}

.modern-table .size-badge {
    background: linear-gradient(180deg, #f7faff, #edf4fd);
}

.modern-table .date-badge {
    background: linear-gradient(180deg, #f8fbff, #eef4fb);
    color: #546b89;
}

.modern-table .actions-cell {
    min-width: 230px;
}

.modern-table .table-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.modern-table .table-actions .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    background: rgba(255,255,255,.9);
    border-width: 1px;
    box-shadow: 0 4px 10px rgba(20, 43, 74, .08);
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.modern-table .table-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(20, 43, 74, .14);
}

.modern-table .table-actions .btn-outline-primary { border-color: #93b6e0; color: #4f7dbc; }
.modern-table .table-actions .btn-outline-secondary { border-color: #c3d0e0; color: #6b7f99; }
.modern-table .table-actions .btn-outline-warning { border-color: #f0cc79; color: #c79009; }
.modern-table .table-actions .btn-outline-info { border-color: #88c4e2; color: #2a9bc7; }
.modern-table .table-actions .btn-outline-success { border-color: #8ccdb8; color: #2d8f73; }
.modern-table .table-actions .btn-outline-danger { border-color: #efb0ba; color: #d25a6c; }

.modern-table .table-actions .btn-outline-primary:hover { background: #eaf3ff; }
.modern-table .table-actions .btn-outline-secondary:hover { background: #f2f6fb; }
.modern-table .table-actions .btn-outline-warning:hover { background: #fff7df; }
.modern-table .table-actions .btn-outline-info:hover { background: #e8f8ff; }
.modern-table .table-actions .btn-outline-success:hover { background: #ebfbf4; }
.modern-table .table-actions .btn-outline-danger:hover { background: #fff0f3; }

@media (max-width: 991px) {
    .dashboard-files-wrap {
        padding: 10px;
        border-radius: 18px;
    }

    .modern-table {
        min-width: 860px;
    }
}


@media (max-width: 767px) {
    .dashboard-files-wrap {
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible !important;
    }

    .modern-table {
        min-width: 0 !important;
        width: 100%;
        border-spacing: 0;
    }

    .modern-table thead {
        display: none;
    }

    .modern-table,
    .modern-table tbody,
    .modern-table tr,
    .modern-table td {
        display: block;
        width: 100%;
    }

    .modern-table tbody tr {
        margin: 0 0 14px 0;
        padding: 14px;
        border-radius: 20px;
        background: linear-gradient(180deg, rgba(251,253,255,.98), rgba(241,247,253,.96));
        border: 1px solid rgba(205, 220, 239, .9);
        box-shadow: 0 10px 24px rgba(12, 28, 52, .10);
        filter: none;
        overflow: hidden;
    }

    .modern-table tbody td {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 8px 0;
        min-width: 0 !important;
    }

    .modern-table tbody td:first-child {
        padding-top: 0;
    }

    .modern-table tbody td:last-child {
        padding-bottom: 0;
    }

    .modern-table tbody td:nth-child(2)::before,
    .modern-table tbody td:nth-child(3)::before,
    .modern-table tbody td:nth-child(4)::before,
    .modern-table tbody td:nth-child(5)::before {
        display: block;
        margin-bottom: 6px;
        font-size: .74rem;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #6c82a0;
    }

    .modern-table tbody td:nth-child(2)::before { content: "Carpeta"; }
    .modern-table tbody td:nth-child(3)::before { content: "Tamaño"; }
    .modern-table tbody td:nth-child(4)::before { content: "Fecha"; }
    .modern-table tbody td:nth-child(5)::before { content: "Acciones"; }

    .modern-table .file-name-main {
        font-size: 1rem;
        line-height: 1.2;
    }

    .modern-table .file-name-sub {
        font-size: .88rem;
        word-break: break-word;
    }

    .modern-table .folder-badge,
    .modern-table .size-badge,
    .modern-table .date-badge {
        min-height: 34px;
        padding: 0 10px;
        max-width: 100%;
        white-space: normal;
    }

    .modern-table .actions-cell {
        min-width: 0;
    }

    .modern-table .table-actions {
        justify-content: flex-start;
        gap: 10px;
    }

    .modern-table .table-actions .btn {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
}
