/* ==========================================================================
   XSOL DATA Enterprise Admin & Cloud Drive Portal CSS (Ice-Blue & Compact)
   ========================================================================== */

:root {
  /* Dark Sidebar & Header Tokens */
  --adm-sidebar-bg: #0d1322;
  --adm-sidebar-border: rgba(255, 255, 255, 0.07);
  --adm-sidebar-text: #9ca3af;
  --adm-sidebar-hover: rgba(255, 255, 255, 0.05);

  /* Ice-Blue Main Dashboard Tokens */
  --adm-main-bg: #eaf2fb;
  --adm-card-bg: #ffffff;
  --adm-card-border: #d3e4f7;
  --adm-text-title: #0f172a;
  --adm-text-body: #334155;
  --adm-text-sub: #64748b;
  --adm-primary: #2563eb;
  --adm-primary-hover: #1d4ed8;
  --adm-ice-accent: #0284c7;
  --adm-ice-surface: #f0f7ff;
  --adm-ice-border: #bfdbfe;

  --adm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body:has(.admin-root) {
  margin: 0;
  padding: 0;
  font-family: var(--adm-font);
  background: var(--adm-sidebar-bg) !important;
  overflow-x: hidden;
  font-size: 13px;
}

.admin-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== COMPACT LOGIN PAGE (OFF-WHITE THEME) ==================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #edf2f7;
  background-image: 
    radial-gradient(at 10% 10%, rgba(37, 99, 235, 0.08) 0px, transparent 45%),
    radial-gradient(at 90% 90%, rgba(2, 132, 199, 0.06) 0px, transparent 45%),
    linear-gradient(135deg, #eef3f8 0%, #e2eaf2 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fafbfc;
  border: 1px solid #d5dee7;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.08), 0 2px 10px rgba(0, 0, 0, 0.03);
  animation: fadeInDown 0.3s ease-out;
}

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

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 50px;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 5px;
}

.login-subtitle {
  color: #64748b;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.35;
}

.form-group {
  margin-bottom: 15px;
}

.login-card .form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

.input-with-icon {
  position: relative;
}

.login-card .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.82rem;
}

.login-card .form-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px 9px 34px;
  color: #0f172a;
  font-size: 0.86rem;
  transition: all 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

.login-card .form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  background: #ffffff;
}

.login-card .form-input::placeholder {
  color: #94a3b8;
}

.login-card .pwd-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}

.login-card .pwd-toggle-btn:hover {
  color: #475569;
}

.btn-primary-glow {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-glow:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.btn-primary-glow:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== COMPACT DASHBOARD TOP HEADER ==================== */
.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--adm-sidebar-bg);
  border-bottom: 1px solid var(--adm-sidebar-border);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

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

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
}

.brand-badge span.accent {
  color: #3b82f6;
}

.drive-tag {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 5px;
}

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

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 10px 3px 4px;
  border-radius: 50px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.74rem;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #f87171;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ==================== DASHBOARD BODY ==================== */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 52px);
  background: var(--adm-main-bg);
}

/* 1. COMPACT DARK SIDEBAR */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--adm-sidebar-bg);
  border-right: 1px solid var(--adm-sidebar-border);
  padding: 16px 12px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-nav-title {
  color: #64748b;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.7px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 3px;
}

.sidebar-nav-item i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

.sidebar-nav-item:hover {
  background: var(--adm-sidebar-hover);
  color: #ffffff;
}

.sidebar-nav-item.active {
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-weight: 600;
}

/* 2. ICE BLUE MAIN CONTENT AREA */
.dashboard-content {
  flex: 1;
  padding: 20px 24px 50px;
  background: var(--adm-main-bg);
  color: var(--adm-text-body);
  box-sizing: border-box;
  min-width: 0;
}

/* COMPACT STATS ROW (TOTAL FILES & STORAGE USED) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-card-border);
  border-radius: 11px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.09);
  border-color: #bfdbfe;
}

.stat-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-cyan { background: #ecfeff; color: #0891b2; }

.stat-title {
  font-size: 0.72rem;
  color: var(--adm-text-sub);
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--adm-text-title);
  margin: 0;
}

/* COMPACT UPLOAD PANEL (ICE-BLUE STYLE) */
.upload-panel {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-card-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.04);
}

.upload-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--adm-text-title);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title i {
  font-size: 1rem;
}

.dropzone-area {
  border: 1.5px dashed #93c5fd;
  border-radius: 9px;
  padding: 18px 16px;
  text-align: center;
  background: var(--adm-ice-surface);
  cursor: pointer;
  transition: all 0.15s;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: #2563eb;
  background: #e0f2fe;
}

.dropzone-icon {
  font-size: 1.6rem;
  color: #2563eb;
  margin-bottom: 6px;
}

.dropzone-text-main {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}

.dropzone-text-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0;
}

.upload-options-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 12px;
  margin-top: 14px;
  align-items: end;
}

/* Form inputs in Main Area */
.dashboard-content .form-label {
  color: #475569;
  font-size: 0.76rem;
}

.dashboard-content .form-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 7px 11px;
  font-size: 0.84rem;
  border-radius: 7px;
}

.dashboard-content .form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

/* COMPACT FILES LIST PANEL */
.files-panel {
  background: var(--adm-card-bg);
  border: 1px solid var(--adm-card-border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.04);
}

.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 220px;
}

.search-box .input-icon {
  left: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.search-box .form-input {
  padding-left: 30px;
}

.filter-tabs {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px;
  border-radius: 8px;
  gap: 2px;
}

.filter-tab {
  background: none;
  border: none;
  color: #64748b;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.filter-tab:hover {
  color: #0f172a;
}

.filter-tab.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

/* COMPACT TABLE */
.table-responsive-custom {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 9px 12px;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.custom-table td {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--adm-text-body);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
}

.custom-table tbody tr:hover td {
  background: #f4f8fe;
}

.file-name-col {
  display: flex;
  align-items: center;
  gap: 9px;
}

.file-type-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.file-type-pdf { background: #fee2e2; color: #dc2626; }
.file-type-doc { background: #eff6ff; color: #2563eb; }
.file-type-ppt { background: #ffedd5; color: #ea580c; }
.file-type-image { background: #f3e8ff; color: #9333ea; }
.file-type-other { background: #f1f5f9; color: #64748b; }

.file-title-text {
  font-weight: 600;
  color: #0f172a;
  display: block;
  font-size: 0.82rem;
}

.file-orig-name {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* PUBLIC LINK BOX & COPY */
.public-link-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.76rem;
  color: #1d4ed8;
}

.btn-copy-link {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.btn-copy-link:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-copy-link.copied {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-size: 0.78rem;
}

.btn-action-icon:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-action-delete:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog-custom {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 22px;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.2);
  color: #0f172a;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.btn-secondary-custom {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-secondary-custom:hover {
  background: #e2e8f0;
}

.btn-danger-custom {
  background: #dc2626;
  border: none;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger-custom:hover {
  background: #b91c1c;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--adm-sidebar-border);
  }
  .upload-options-row {
    grid-template-columns: 1fr;
  }
}
