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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f1219;
    color: #e0e2e8;
    min-height: 100vh;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1219 0%, #1a1f2e 100%);
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: #1a1f2e;
    border: 1px solid #2a3040;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo svg {
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #e0e2e8;
}

.login-header .subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 6px;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    background: #0f1219;
    border: 1px solid #2a3040;
    border-radius: 8px;
    color: #e0e2e8;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #4f8ef7;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: normal;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4f8ef7;
    cursor: pointer;
}

input[type="file"] {
    padding: 8px;
    font-size: 13px;
}

input[type="file"]::file-selector-button {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: #2a3040;
    color: #e0e2e8;
    cursor: pointer;
    font-size: 13px;
    margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
    background: #353d52;
}

textarea {
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #4f8ef7;
    color: #fff;
}

.btn-primary:hover {
    background: #3b7de6;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #2a3040;
    color: #e0e2e8;
}

.btn-secondary:hover {
    background: #353d52;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ========== DASHBOARD ========== */
.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #1a1f2e;
    border-bottom: 1px solid #2a3040;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left .logo svg {
    display: block;
}

.topbar-left h2 {
    font-size: 18px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-info {
    font-size: 12px;
    color: #6b7280;
    padding: 4px 10px;
    background: #0f1219;
    border-radius: 6px;
}

.connection-info strong {
    color: #9ca3af;
}

/* ========== BREADCRUMB ========== */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #151a28;
    border-bottom: 1px solid #2a3040;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #4f8ef7;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.breadcrumb a:hover {
    background: rgba(79, 142, 247, 0.1);
}

.breadcrumb span {
    color: #6b7280;
    font-size: 13px;
}

.breadcrumb .separator {
    color: #3a4055;
    user-select: none;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

/* ========== FILE TABLE ========== */
.files-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.file-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    background: #1a1f2e;
    border-bottom: 1px solid #2a3040;
    font-weight: 600;
}

.file-table td {
    padding: 8px 16px;
    font-size: 13px;
    border-bottom: 1px solid #1e2335;
    vertical-align: middle;
}

.file-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.file-table tbody tr:hover {
    background: rgba(79, 142, 247, 0.06);
}

.file-table .col-icon { width: 32px; text-align: center; }
.file-table .col-name { }
.file-table .col-size { width: 100px; text-align: right; }
.file-table .col-modified { width: 170px; }
.file-table .col-perms { width: 90px; }
.file-table .col-actions { width: 100px; text-align: center; }

.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.file-icon.dir {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.file-icon.file {
    color: #4f8ef7;
    background: rgba(79, 142, 247, 0.12);
}

.file-icon.image {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.file-icon.archive {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
}

.file-name {
    color: #e0e2e8;
    font-weight: 500;
}

.file-size {
    color: #9ca3af;
    font-family: 'Consolas', monospace;
    font-size: 12px;
}

.file-mtime {
    color: #6b7280;
    font-size: 12px;
}

.file-perms {
    color: #6b7280;
    font-family: 'Consolas', monospace;
    font-size: 12px;
}

.file-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    padding: 4px;
}

.btn-action:hover {
    background: #2a3040;
    color: #e0e2e8;
}

.btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1f2e;
    border: 1px solid #2a3040;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
}

.modal-close:hover {
    color: #e0e2e8;
    background: #2a3040;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 20px;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #0f1219;
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0;
    display: none;
}

.progress-bar.active {
    display: block;
}

.progress-bar .fill {
    height: 100%;
    background: #4f8ef7;
    border-radius: 3px;
    transition: width 0.3s;
    width: 0;
}

/* ========== CONTEXT MENU ========== */
.context-menu {
    display: none;
    position: fixed;
    background: #1a1f2e;
    border: 1px solid #2a3040;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 2000;
    min-width: 160px;
    padding: 4px;
}

.context-menu.active {
    display: block;
}

.context-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: #e0e2e8;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}

.context-menu button:hover {
    background: rgba(79, 142, 247, 0.12);
    color: #4f8ef7;
}

.context-menu button.danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.toast.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast.info {
    background: rgba(79, 142, 247, 0.2);
    border: 1px solid rgba(79, 142, 247, 0.3);
    color: #93c5fd;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== DRAG & DROP ========== */
.drop-zone {
    border: 2px dashed #2a3040;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    margin: 16px 0;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4f8ef7;
    background: rgba(79, 142, 247, 0.05);
}

.drop-zone p {
    color: #6b7280;
    font-size: 14px;
    margin-top: 8px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f1219; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a4055; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .login-card { padding: 28px 20px; }
    .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
    .breadcrumb-bar { padding: 8px 16px; }
    .file-table th, .file-table td { padding: 6px 10px; }
    .file-table .col-perms { display: none; }
    .file-table .col-modified { display: none; }
    .file-actions { flex-direction: column; }
    .form-row { flex-direction: column; }
}
