*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Tahoma, Arial, sans-serif;
    background: #1a1a2e;
    color: #cdd6f4;
    direction: rtl;
    min-height: 100vh;
}

/* ── Login ── */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: #16213e;
    border: 1px solid #313244;
    border-radius: 12px;
    padding: 2rem;
    width: 320px;
}
.login-box h2 { text-align: center; margin-bottom: 1.4rem; color: #89b4fa; }
.login-box input {
    width: 100%; padding: .6rem .8rem;
    background: #1e1e2e; border: 1px solid #45475a;
    border-radius: 8px; color: #cdd6f4;
    margin-bottom: .8rem; font-size: .95rem;
}
.login-box button {
    width: 100%; padding: .7rem;
    background: #89b4fa; color: #1e1e2e;
    border: none; border-radius: 8px;
    font-size: 1rem; cursor: pointer; font-weight: bold;
}
.login-box button:hover { background: #74c7ec; }
.error-msg { color: #f38ba8; text-align: center; margin-bottom: .8rem; font-size: .9rem; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 200px; background: #16213e;
    border-left: 1px solid #313244;
    padding: 1.2rem .8rem;
    display: flex; flex-direction: column; gap: .4rem;
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: 100;  /* اضافه کن */
}
.sidebar h2 { color: #89b4fa; font-size: 1rem; margin-bottom: .8rem; text-align: center; }
.sidebar a {
    display: block; padding: .5rem .8rem;
    color: #cdd6f4; text-decoration: none;
    border-radius: 8px; font-size: .9rem;
    cursor: pointer;
}
.sidebar a:hover { background: #313244; }
.sidebar .logout { color: #f38ba8; margin-top: auto; }

.main { margin-right: 200px; padding: 1.2rem; flex: 1; }

/* ── Toolbar ── */
.toolbar {
    display: flex; align-items: center; gap: .6rem;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.breadcrumb {
    flex: 1; display: flex; align-items: center;
    gap: .3rem; flex-wrap: wrap; font-size: .9rem;
}
.breadcrumb span { color: #89b4fa; cursor: pointer; }
.breadcrumb span:hover { text-decoration: underline; }
.breadcrumb .sep { color: #585b70; }

/* ── Buttons ── */
.btn {
    padding: .45rem .9rem; border: none; border-radius: 8px;
    cursor: pointer; font-size: .88rem; font-weight: bold;
}
.btn-primary { background: #89b4fa; color: #1e1e2e; }
.btn-primary:hover { background: #74c7ec; }
.btn-success { background: #a6e3a1; color: #1e1e2e; }
.btn-success:hover { background: #94e2d5; }
.btn-danger  { background: #f38ba8; color: #1e1e2e; }
.btn-danger:hover  { background: #eba0ac; }
.btn-sm {
    padding: .25rem .6rem; border: none; border-radius: 6px;
    cursor: pointer; font-size: .8rem; font-weight: bold;
}
.btn-sm.danger { background: #f38ba8; color: #1e1e2e; }
.btn-sm.copy   { background: #89b4fa; color: #1e1e2e; }
.btn-sm.rename { background: #fab387; color: #1e1e2e; }
.btn-sm.move   { background: #a6e3a1; color: #1e1e2e; }

/* ── File Table ── */
.file-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.file-table th {
    background: #16213e; padding: .6rem .8rem;
    text-align: right; color: #89b4fa;
    border-bottom: 1px solid #313244;
}
.file-table td { padding: .55rem .8rem; border-bottom: 1px solid #1e1e2e; }
.file-table tr:hover td { background: #1e1e2e; }
.file-table .name-cell { cursor: pointer; color: #89b4fa; }
.file-table .name-cell:hover { text-decoration: underline; }
.icon { margin-left: .4rem; }

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed #45475a;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #585b70;
    margin-bottom: 1rem;
    transition: all .2s;
}
.drop-zone.dragover {
    border-color: #89b4fa;
    background: #1e1e2e;
    color: #89b4fa;
}
.drop-zone p { font-size: .95rem; }

/* ── Modal ── */

.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.overlay.hidden { display: none; }
.modal {
    background: #16213e;
    border: 1px solid #313244;
    border-radius: 12px;
    padding: 1.4rem;
    width: 420px; max-width: 95vw;
    max-height: 80vh; overflow-y: auto;
}
/* modal-backdrop */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;  /* همین بمونه */
}

.modal-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 1rem;
}
.modal-header h3 { color: #89b4fa; }
.modal-close { background: none; border: none; color: #cdd6f4; font-size: 1.3rem; cursor: pointer; }
.modal input, .modal select {
    width: 100%; padding: .55rem .8rem;
    background: #1e1e2e; border: 1px solid #45475a;
    border-radius: 8px; color: #cdd6f4;
    margin-bottom: .7rem; font-size: .9rem;
}
.modal table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.modal table th { color: #89b4fa; padding: .4rem; border-bottom: 1px solid #313244; text-align: right; }
.modal table td { padding: .4rem; border-bottom: 1px solid #1e1e2e; }

/* ── Upload Progress ── */
.upload-list { margin-top: .8rem; }
.upload-item { margin-bottom: .6rem; font-size: .85rem; }
.upload-item .name { margin-bottom: .2rem; }
.progress-bar-wrap {
    background: #1e1e2e; border-radius: 4px; height: 6px; overflow: hidden;
}
.progress-bar {
    height: 100%; background: #89b4fa;
    border-radius: 4px; width: 0;
    transition: width .2s;
}

/* ── Toast ── */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    background: #313244; color: #cdd6f4;
    padding: .6rem 1.4rem; border-radius: 20px;
    z-index: 200; font-size: .9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    animation: fadeUp .2s ease;
}
@keyframes fadeUp {
    from { opacity: 0; bottom: 1rem; }
    to   { opacity: 1; bottom: 1.5rem; }
}

.hidden { display: none !important; }
