:root {
  --primary: #4f46e5;
  --primary-light: #eef2ff;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --sidebar: #0f172a;
  --border: #e2e8f0;
  --yellow: #f59e0b;
}

* {
  box-sizing: border-box; /* Padding တွေ အားလုံးကို Width ထဲမှာပဲ ထည့်တွက်ခိုင်းတာပါ */
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-body);
  color: var(--text);
  margin: 0;
  height: 100vh;
  overflow: hidden;
  /* iOS safe area အတွက် */
  padding-bottom: env(safe-area-inset-bottom);
}

/* --- LOGIN SCREEN --- */
#login-view {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 2000;
}
.login-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  width: 90%;
  max-width: 380px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: white;
}
.logo-circle {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  margin: 0 auto 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  color: white;
}
.btn-google {
  background: white;
  border: none;
  padding: 14px;
  width: 100%;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  font-size: 16px;
  color: #1e293b;
  transition: transform 0.2s;
}
.btn-google:active {
  transform: scale(0.98);
}
.btn-google img {
  width: 22px;
}

/* --- APP LAYOUT --- */
.view {
  width: 100%;
  height: 100%;
  display: flex;
}

/* Sidebar (Desktop) */
.sidebar {
  width: 260px;
  /* background: var(--sidebar); */
  background: linear-gradient(90deg, #001f16, #463100eb);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex-shrink: 0;
  height: 100dvh; /* sidebar ကို အမြင့်အပြည့် အသေထားမယ် */
}
.brand {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 10px;
}
.menu-container::-webkit-scrollbar {
  display: none;
}

.menu-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 20px 0 10px 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.menu-item {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 12px 15px;
  text-align: left;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transition: 0.2s;
}
.menu-item:hover,
.menu-item.active {
  margin-top: 10px;
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.text-yellow {
  color: var(--yellow) !important;
}

/* User Panel */
.user-panel {
  flex-shrink: 0;         /* အောက်ခြေက User Panel ကို လုံးဝ မမြုပ်သွားအောင် တားမယ် */
  margin-top: auto;       /* အမြဲတမ်း အောက်ဆုံးမှာ ကပ်နေမယ် */
  background: rgba(255, 255, 255, 0.01);
  padding: 15px;
  border-radius: 12px;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
#user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}
.user-details {
  display: flex;
  flex-direction: column;
}
#user-name {
  font-size: 14px;
  font-weight: 600;
}
.btn-sm {
  background: none;
  border: none;
  color: #f87171;
  text-align: left;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}

/* Main Content */
.main-area {
  flex: 1;
  padding: 25px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 20px;
  align-items: center;
}
.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}
.search-bar input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  transition: 0.2s;
}
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-bar i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.view-toggles {
  margin-left: 42px;
  display: flex;
  background: white;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.btn-toggle {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  width: 38px;
  height: 38px;
}
.btn-toggle.active {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
  transition: 0.2s;
  width: 100%;
}

#unlock-view .btn-primary i {
  font-size: 18px; /* Icon ဆိုဒ် */
}

.btn-primary:active {
  transform: scale(0.95);
}

/* Status Bar */
.status-bar {
  background: #fff7ed;
  color: #c2410c;
  padding: 10px 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ffedd5;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.hidden {
  display: none;
}

/* List Layouts */

.list-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 100px;
}

/* Card Design */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}
.cat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.card-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  font-size: 15px;
  margin-left: 5px;
}
.card-actions button:hover {
  color: var(--text);
}

.card-title {
  padding-left: 7px;
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-user {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 15px;
  display: block;
}
.card-pass {
  background: var(--bg-body);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: "Courier New", monospace;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  align-items: center;
}
.blur {
  filter: blur(5px);
  opacity: 0.7;
}
.no-blur {
  filter: none;
  opacity: 1;
}

/* List Mode Specifics */
.list-layout .card-title {
  margin: 0;
  min-width: 150px;
}
.list-layout .card-user {
  margin: 0;
  margin-right: 20px;
  display: none;
} /* Mobile List Hide User */
.list-layout .card-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}
.list-layout .card-pass {
  display: none;
}

/* --- MODAL (Improved) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 20px; /* Screen ဘေးဘောင်နဲ့ မကပ်အောင် */
}
.modal-content {
  background: white;
  padding: 25px 30px; /* အတွင်း Padding ညီအောင် */
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: zoomIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;

  /* ★ ဘေးဘောင်မကပ်အောင် အရေးကြီးဆုံးအချက် ★ */
  box-sizing: border-box;
}
@keyframes zoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.close {
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  background: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Desktop မှာ ၂ တိုင် */
  gap: 15px;
  width: 100%;
}

.modal-body {
  width: 100%;
  padding: 25px !important;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box; /* Padding ကြောင့် ဆိုဒ်မပြောင်းအောင် */
}

.input-group {
  margin-bottom: 15px;
  width: 100%; /* အကျယ်အပြည့်ယူမယ် */
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%; /* မိဘအကျယ်အတိုင်း ယူမယ် */
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: #f8fafc;
  transition: 0.2s;
  box-sizing: border-box; /* ဘောင်အပြင်မထွက်အောင် */
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px #eef2ff;
}

.pass-box {
  display: flex; /* ဘေးတိုက်စီမယ် */
  gap: 10px; /* Input နဲ့ Button ကြားကွာမယ် */
  width: 100%; /* အကျယ်အပြည့် */
  align-items: stretch; /* အမြင့်ညီအောင် */
}

.pass-box .icon-input {
  flex-grow: 1; /* ကျန်တဲ့နေရာလွတ် အကုန်ယူမယ် */
  width: auto; /* Fixed width မဟုတ်တော့ဘူး */
}

.icon-input {
  position: relative;
  width: 100%; /* အပြည့်ယူမယ် */
}

.icon-input i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  z-index: 2; /* Input ပေါ်မှာနေမယ် */
}

.icon-input input {
  padding-left: 40px !important; /* Icon နဲ့ မထပ်အောင် */
  width: 100%;
}

.btn-gen {
  background: #f1f5f9;
  border: 1px solid var(--border);
  width: 50px; /* ခလုတ်အကျယ် */
  border-radius: 10px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: 0.2s;
  flex-shrink: 0; /* နေရာကျဉ်းရင် မကျုံ့သွားစေရ */
  height: auto; /* Input အမြင့်နဲ့ အလိုအလျောက်ညီမယ် */
}

.btn-gen:hover {
  background: #e2e8f0;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-save {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

/* Guide Content */
.guide-list {
  padding-left: 20px;
  line-height: 1.8;
  color: var(--text);
  font-size: 14px;
}
.privacy-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 15px;
  border-radius: 12px;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
  #app-view {
    flex-direction: column;
  }

  /* Mobile Top Bar (Chips Style) */
  .sidebar {
    width: 100%;
    height: 65px;
    position: fixed;
    top: 0;
    left: 0;

    display: flex; /* Flexbox သုံးမယ် */
    flex-direction: row;
    justify-content: space-between; /* ဘယ်ညာ ခွဲထုတ်မယ် */
    align-items: center;
    padding: 0 15px;

    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, #5fffd4c9, #effe7bc4);
    z-index: 5000 !important; /* Modal အောက်၊ Content အပေါ် */
    overflow: hidden; /* Scroll logic inside container */
  }

  .brand,
  .menu-label,
  .btn-sm {
    display: none !important;
  }

  .user-details,
  .btn-sm,
  .btn-logout-icon {
    pointer-events: auto !important; /* နှိပ်လို့ရအောင် ဖွင့်ပေးမယ် */
    cursor: pointer;
  }

  /* Scroll Container */
  .menu-container {
    display: flex; /* Flexbox သုံးမယ် */
    flex-direction: row; /* ဘေးတိုက်စီမယ် (အရေးကြီးဆုံး) */
    align-items: center; /* အလယ်တည့်တည့် */
    gap: 10px; /* ခလုတ်တွေကြား အကွာအဝေး */
    width: 100%;

    /* Scroll Settings */
    overflow-x: auto; /* ဘယ်ညာ Scroll ဖွင့်မယ် */
    overflow-y: hidden; /* အပေါ်အောက် ပိတ်မယ် */
    white-space: nowrap; /* စာကြောင်း မကျိုးစေရ */

    /* Padding */
    padding: 0 15px;

    /* Smooth Scroll for iOS */
    -webkit-overflow-scrolling: touch;

    /* Scrollbar ဖျောက်ခြင်း */
    scrollbar-width: none;
  }

  .menu-container::-webkit-scrollbar {
    display: none;
  }
  /* Menu Items (Pills) */
  .menu-item {
    /* မကျုံ့သွားအောင် တားမယ် (အရေးကြီးဆုံး) */
    flex-shrink: 0;

    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    margin: 0;

    font-size: 13px;
    color: #64748b;

    display: flex;
    align-items: center;
    gap: 6px;
  }

  .menu-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .menu-item i {
    font-size: 14px;
  }

  /* User Panel (Profile Pill) */
  .user-panel {
    flex-shrink: 0; /* မကျုံ့စေရ */
    margin-left: auto; /* ညာဘက်အစွန်ဆုံး တွန်းပို့မယ် (Optional) */
    border-left: 1px solid #e2e8f0;
    padding-left: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  #user-avatar {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary);
  }
  .user-details {
    display: none;
  } /* Hide Name/Logout Text */

  /* Show Logout Icon instead */
  .user-panel::after {
    content: none;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #ef4444;
    cursor: pointer;
    padding: 5px; /* နှိပ်ရလွယ်အောင် */

    /* ★ Click Event အလုပ်လုပ်အောင် ★ */
    pointer-events: auto;
  }

  /* Content */
  .main-area {
    padding: 15px;
    padding-top: 85px;
  } /* Space for top bar */
  header {
    flex-direction: column-reverse;
    gap: 15px;
  } /* Search below buttons */

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .search-bar {
    width: 100%;
  }
  .desk-only {
    display: none;
  } /* Hide "Add New" text */
  .btn-primary {
    width: 45px;
    height: 45px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  /* Mobile Modal (Bottom Sheet) */
  .modal {
    align-items: flex-end; /* Bottom Sheet ပုံစံ */
    padding: 0;
    z-index: 3000 !important;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 25px 20px;
    animation: slideUpSheet 0.3s ease;
  }
  @keyframes slideUpSheet {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .btn-mobile-logout {
    display: block !important;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
  }

  .grid-layout {
    grid-template-columns: 1fr; /* တစ်တိုင်တည်း */
    padding-bottom: 120px;
  }

  .list-layout .cat-icon-large {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .cat-title-label {
    font-size: 14px;
  }
  .cat-icon-large {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .list-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 90px;
  }

  .list-layout .card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important; /* ဒေါင်လိုက် အလယ်တည့်တည့် ပို့ပေးတာ ဒါပါ */
    /* padding: 10px 15px; */
    border-radius: 14px;
    /* min-height: 60px;  */
    /* အနည်းဆုံး အမြင့် */
    position: relative; /* ခလုတ်တွေကို နေရာချဖို့ Reference */
    height: 80px !important; /* Card အမြင့်ကို ပုံေသထားမယ် */
    padding: 0 20px !important; /* ဘေးဘောင် Padding */
    gap: 15px;
  }

  /* 1. Icon Section */
  .list-layout .card-header {
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: auto;
    display: flex; /* Flex ဖြုတ်မယ် */
    align-items: center;
  }

  .list-layout .cat-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width: auto;
    margin-right: 12px; /* Icon နဲ့ စာ ကြားကွာဟချက် */
  }

  .list-layout .cat-icon-large {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }

  /* Mobile List မှာ Category Name ရှုပ်လို့ ဖျောက်ထားမယ် (Icon အရောင်နဲ့ သိသာလို့) */
  .list-layout .cat-title-label {
    display: none;
  }

  /* 2. Content Section (Title) */
  .list-layout .card-content {
    margin-top: 0 !important;
    flex: 1; /* ကျန်တဲ့နေရာ အကုန်ယူ */
    min-width: 0; /* စာရှည်ရင် ... ဖြစ်အောင် */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 90px; /* ★ ခလုတ်တွေနဲ့ မထပ်အောင် ညာဘက်နေရာချန်မယ် ★ */
  }

  .list-layout .card-title {
    font-size: 14px !important;
    margin: 0 !important;
    /* margin-bottom: 2px; */
    padding: 0 !important;
    line-height: 1.3;
  }
  .list-layout .card-user {
    font-size: 11px !important;
    margin: 0 !important;
    display: block !important;
  }

  /* 3. Actions Buttons (ညာဘက် အသေကပ်) */
  .list-layout .card-actions {
    position: absolute; /* Card ပေါ်မှာ ပျံနေမယ် */
    right: 10px;
    top: 50%; /* အပေါ်အောက် အလယ် */
    transform: translateY(-50%); /* အလယ်တည့်တည့်ညှိ */

    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9); /* စာတွေနဲ့ထပ်ရင် နောက်ခံကာမယ် */
    padding-left: 5px;
  }

  .list-layout .card-actions button {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
    background: #f1f5f9;
  }
}

.btn-mobile-logout {
  display: none;
}

/* --- PROFESSIONAL MODAL & DOC STYLING --- */

/* Modal Size & Layout */
.modal-large {
  max-width: 700px;
  width: 95%;
  height: 90vh; /* စာရွက်စာတမ်းဖတ်ရသလို ရှည်ရှည်လေးဖြစ်မယ် */
  padding: 0 !important; /* Padding ဖယ်ပြီး Header/Body ခွဲမယ် */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.no-border {
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  background: #f8fafc;
  border-radius: 20px 20px 0 0;
}

.modal-header.no-border {
  flex-shrink: 0; /* Header ကို မကျုံ့စေရ */
  padding: 15px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.scroll-body {
  flex: 1; /* ကျန်တဲ့နေရာ အကုန်ယူမယ် */
  overflow-y: auto; /* ဒေါင်လိုက် Scroll ဆွဲမယ် */
  padding: 20px 30px;
  -webkit-overflow-scrolling: touch; /* Mobile Smooth Scroll */
}

/* --- UNLOCK SCREEN STYLE --- */
#unlock-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    #064e3b 0%,
    #10b981 100%
  ); /* Green Theme for Security */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/* Tab Navigation */
.tab-header {
  display: flex;
  gap: 30px;
}

.tab-link {
  background: none;
  border: none;
  padding: 20px 5px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: 0.2s;
}

.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-link:hover {
  color: var(--text);
}

/* Document Body */
.legal-body {
  padding: 30px 40px;
  background: #ffffff;
  color: #334155;
  font-family: "Inter", sans-serif; /* or 'Georgia' for more classic look */
  line-height: 1.8;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-content.active {
  display: block;
}

/* Typography */
.doc-header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 20px;
}

.doc-header h4 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-header p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.doc-section {
  margin-bottom: 30px;
}

.doc-section h5 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px 0;
}

.doc-section p {
  font-size: 14px;
  text-align: justify;
  margin-bottom: 10px;
}

/* Lists */
.doc-list {
  list-style: none;
  padding: 0;
}

.doc-list li {
  font-size: 14px;
  margin-bottom: 12px;
  padding-left: 15px;
  border-left: 3px solid #e2e8f0;
}

/* Warning Box */
.alert-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 15px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 15px;
  display: flex;
  gap: 10px;
  align-items: start;
}

/* Footer */
.doc-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .legal-body {
    padding: 20px;
  }
  .doc-header h4 {
    font-size: 18px;
  }
  .tab-link {
    padding: 15px 5px;
    font-size: 13px;
  }
}

/* --- ANNOUNCEMENT BANNER --- */
.announcement-box {
  background: linear-gradient(90deg, #ff7e5f, #feb47b); /* Sunset Orange */
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(255, 126, 95, 0.3);
  animation: slideDown 0.5s ease;
}

.announce-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.close-announce {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.close-announce:hover {
  opacity: 1;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* --- ANNOUNCEMENT BANNER Ends --- */

/* --- CARD DESIGN UPDATE --- */
.card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  overflow: hidden; /* နောက်ခံအရောင်တွေ လျှံမထွက်အောင် */
  /* height: 75px; */
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

/* Card Header Layout */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Icon ကြီးနေလို့ အပေါ်ကပ်မယ် */
  margin-bottom: 15px;
}

/* Big Category Icon */
.cat-icon-large {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0; /* Icon မပိန်သွားအောင် */
  transition: transform 0.2s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05); /* အတွင်းဘောင်ပါးပါး */
}
.card:hover .cat-icon-large {
  transform: scale(1.1) rotate(-5deg); /* Hover လုပ်ရင် လှုပ်မယ် */
}

.card-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: center;
}

/* Card Content Clean Up */
.card-content {
  margin-top: 5px;
}

.card-user {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-user,
.card-pass {
  display: none !important;
} /* Username/Pass ကို Card ပေါ်မှာ ဖျောက်မယ် */

/* Action Buttons (Right Aligned) */
.card-actions {
  display: flex;
  gap: 6px;
}
.card-actions button {
  background: transparent;
  border: 1px solid transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.card-actions button:hover {
  background: #f1f5f9;
  color: var(--text);
  border-color: #e2e8f0;
}

.btn-star.active {
  color: #f59e0b !important;
}
.btn-del:hover {
  background: #fef2f2 !important;
  color: #ef4444 !important;
  border-color: #fecaca !important;
}

.list-layout .card {
  flex-direction: row;
  align-items: center;
  /* padding: 12px 20px; */
  /* gap: 20px; */
}
.list-layout .card-header {
  margin: 0;
}
.list-layout .cat-icon-large {
  width: 48px;
  height: 48px;
  font-size: 22px;
} /* List မှာ နည်းနည်းပြန်သေးမယ် */
.list-layout .card-content {
  height: 45px;
  flex: 1;
  margin: 0;
  min-width: 0;
}
.list-layout .card-actions {
  margin-left: auto;
}

/* --- VIEW DETAILS MODAL STYLING --- */
.view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}
.view-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 1px solid #e2e8f0;
}
.view-box label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 5px;
  font-weight: 600;
}

.copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.copy-row i {
  color: var(--primary);
  cursor: pointer;
}
.copy-row span {
  font-family: monospace;
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
}

.blur-text {
  filter: blur(5px);
  cursor: pointer;
  user-select: none;
}
.blur-text.revealed {
  filter: none;
  user-select: text;
}

.badge {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.val-text {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
#view-url a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}
.note-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* --- BEAUTIFUL VIEW MODAL --- */
.view-card {
  padding: 0 !important;
  width: 95% !important;
  max-width: 500px !important;
  border-radius: 24px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Modal Body Scroll Fix */
.view-card .modal-body {
  overflow-y: auto; /* Scroll ဆွဲလို့ရမယ် */
  padding: 30px;
  flex: 1; /* ကျန်တဲ့နေရာအကုန်ယူမယ် */
  max-height: calc(90vh - 120px); /* Header နှုတ်ပြီး ကျန်တာ Scroll */
}

/* Header Styling */
.view-header-section {
  background: #f8fafc;
  padding: 30px 20px;
  flex-shrink: 0; /* Scroll ဆွဲရင် Header မပါသွားအောင် */
  text-align: center;
  position: relative;
  border-bottom: 1px solid #e2e8f0;
}

/* Icon နဲ့ စာသား တွဲထားမည့် Group */
.cat-group {
  display: flex;
  align-items: center;
  gap: 12px; /* Icon နဲ့ စာကြား ကွာဟချက် */
  flex: 1;
  overflow: hidden; /* စာရှည်ရင် ပြတ်မထွက်အောင် */
}

/* Category Title Styling */
.cat-title-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* List View မှာ စာသားကို ပိုထင်ရှားစေမယ် */
.list-layout .cat-title-label {
  font-size: 16px;
}

.view-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  transition: 0.2s;
}
.view-close-btn:hover {
  background: #ef4444;
  color: white;
}

.view-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 15px;
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

#view-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.view-badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #64748b;
}

/* Visit Button */
.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s;
  width: auto;
}
.btn-visit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

.note-content-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;

  /* Text Alignment */
  text-align: left; /* ဘယ်ဘက်ကပ်မယ် */
  line-height: 1.6;
  font-size: 14px;
  color: #334155;
  white-space: pre-wrap; /* စာကြောင်းအဆင်း (Enter) တွေကို သိအောင် */
  word-break: break-word; /* စာရှည်ရင် အောက်ဆင်းအောင် */
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.detail-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.detail-box.full-width {
  margin-top: 0;
}

.detail-box label {
  text-align: left; /* Label ကိုလည်း ဘယ်ကပ်မယ် */
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 700;
}

/* Copy Row */
.copy-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.copy-wrapper span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.btn-copy {
  background: white;
  border: 1px solid #e2e8f0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-copy:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.note-content {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Blur Text Logic */
.blur-text {
  filter: blur(5px);
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}
.blur-text.revealed {
  filter: none;
  user-select: text;
}

/* --- EXCEL TABLE STYLE --- */
.table-layout {
  width: 100%;
  overflow-x: auto; /* ဖုန်းမှာဆို ဘေးတိုက်ရွှေ့လို့ရအောင် */
}

.excel-container {
  background: white;
  border-radius: 15px;
  border: 1px solid var(--border);
  overflow-x: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  min-width: 600px; /* Table ပုံစံ ပျက်မသွားအောင် */
}

.excel-table th {
  background: #f8fafc;
  padding: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.excel-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
  font-size: 14px;
}

.excel-table tr:hover {
  background-color: #f1f5f9;
  cursor: pointer;
}

.table-cat-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-pass {
  font-family: monospace;
  letter-spacing: 2px;
  color: #cbd5e1;
}

.fw-bold {
  font-weight: 700;
  color: #0f172a;
}

.table-actions {
  display: flex;
  gap: 10px;
}

.table-actions button {
  border: none;
  background: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  transition: 0.2s;
}

.table-actions button:hover {
  background: var(--primary);
  color: white;
}

.text-red:hover {
  background: #ef4444 !important;
}

/* Mobile အတွက် */
@media (max-width: 768px) {
  .excel-table th:nth-child(3),
  .excel-table td:nth-child(3),
  .excel-table th:nth-child(4),
  .excel-table td:nth-child(4) {
    display: none; /* ဖုန်းမှာ နေရာမလောက်ရင် Username/Pass ဖျောက်ထားမယ် */
  }
}

/* --- IMPROVED LIST VIEW --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 100px;
    width: 100%;
}

.list-layout .card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: white;
    padding: 12px 18px !important;
    border-radius: 16px;
    height: auto !important; /* စာသားအလိုက် အမြင့်ပြောင်းနိုင်အောင် */
    min-height: 70px;
    border: 1px solid #f1f5f9;
    transition: 0.2s;
    gap: 15px;
}

.list-layout .card-left {
    flex-shrink: 0;
}

.list-layout .cat-icon-large {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
    border-radius: 12px !important;
}

.list-layout .card-content {
    flex: 1; /* ကျန်တဲ့နေရာ အကုန်ယူမယ် */
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    margin: 0 !important;
}

.list-layout .card-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b;
    margin-bottom: 2px !important;
    padding: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-layout .card-subtitle {
    font-size: 12px !important;
    color: #64748b;
    margin: 0 !important;
}

.list-layout .card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.list-layout .card-actions button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f8fafc;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.list-layout .card-actions button:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.list-layout .btn-del:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

/* --- SHARED CARD BASE --- */
.card {
  height: fit-content;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.card-main-info {
    display: flex;
    flex: 1;
    align-items: center;
}

.card-text-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-title {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-cat-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 4px;
}

.card-action-box {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-action-box button {
    background: #f8fafc;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
}

.card-action-box button:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.card-action-box .btn-del:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* --- 1. GRID VIEW LAYOUT --- */

.grid-layout .card {
    flex-direction: column; /* အပေါ်အောက်စီမယ် */
    padding: 10px 15px;
}

.grid-layout .card-main-info {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}

.grid-layout .card-icon-box {
    margin-bottom: 15px;
}

.grid-layout .card-title {
    font-size: 16px;
}

.grid-layout .card-action-box {
    justify-content: flex-end; /* ခလုတ်တွေကို ညာဘက်ပို့မယ် */
    border-top: 1px solid #f1f5f9;
    padding-top: 2px;
}

/* --- 2. LIST VIEW LAYOUT --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-layout .card {
    flex-direction: row; /* ဘေးတိုက်စီမယ် */
    padding: 12px 20px;
    align-items: center;
}

.list-layout .card-icon-box {
    margin-right: 18px;
}

.list-layout .card-main-info {
    flex-direction: row;
}

.list-layout .card-title {
    font-size: 15px;
}

.list-layout .card-cat-tag {
    display: inline-block; /* List မှာ Category ကို ဘေးမှာပြမယ်ဆိုရင် */
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* --- LAYOUT WRAPPER (Scroll ဆွဲလို့ရအောင် ပြင်ထားသောအပိုင်း) --- */

/* --- GRID VIEW LAYOUT --- */

.grid-layout .card {
    flex-direction: column !important; /* အပေါ်အောက်စီမယ် */
    padding: 15px;
    height: auto;
}

.grid-layout .card-main-info {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.grid-layout .card-icon-box {
    margin-bottom: 12px;
}

.grid-layout .card-action-box {
    width: 100%;
    display: flex; /* ဒါပါမှ ခလုတ်တွေ ပေါ်မှာပါ */
    justify-content: flex-end; /* ညာဘက်ကပ်မယ် */
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: 10px;
}

/* --- LIST VIEW LAYOUT --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-layout .card {
    flex-direction: row !important; /* ဘေးတိုက်စီမယ် */
    padding: 12px 20px;
    align-items: center;
    height: 80px;
}

.list-layout .card-icon-box {
    margin-right: 18px;
}

.list-layout .card-main-info {
    flex-direction: row;
    align-items: center;
}

.list-layout .card-action-box {
    margin-left: auto; /* ညာဘက်အစွန်ကို တွန်းပို့မယ် */
    display: flex;
}

/* --- LAYOUT WRAPPER (MAIN SCROLL FIX) --- */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Main body မလှုပ်စေရ */
}

/* --- CARD SHARED STYLE --- */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    transition: 0.2s;
    cursor: pointer;
    overflow: hidden;
}
.card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1); }

.card-main-info { display: flex; flex: 1; align-items: center; }
.card-icon-box { flex-shrink: 0; }
.card-text-box { display: flex; flex-direction: column; overflow: hidden; padding: 0 10px; }

.card-title { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cat-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; margin-top: 4px; }

.card-action-box { display: flex; align-items: center; gap: 8px; }
.card-action-box button {
    background: #f8fafc; border: none; width: 32px; height: 32px;
    border-radius: 10px; color: #94a3b8; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.card-action-box button:hover { background: #e2e8f0; color: var(--primary); }
.card-action-box .btn-del:hover { background: #fee2e2; color: #ef4444; }

/* --- 1. GRID VIEW --- */
.grid-layout .card {
    flex-direction: column;
    padding: 15px;
}
.grid-layout .card-main-info { flex-direction: column; align-items: flex-start; }
.grid-layout .card-icon-box { margin-bottom: 12px; }
.grid-layout .card-action-box {
    width: 100%;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    justify-content: flex-end;
}

/* --- 2. LIST VIEW --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.list-layout .card {
    flex-direction: row;
    padding: 12px 20px;
    align-items: center;
}
.list-layout .card-icon-box { margin-right: 15px; }
.list-layout .card-main-info { flex-direction: row; }
.list-layout .card-action-box { margin-left: auto; }

/* Mobile Sidebar Fix */
@media (max-width: 768px) {
    .main-area { padding-top: 75px; } /* Sidebar အမြင့်ထက် ပိုပေးရမယ် */
    .grid-layout { grid-template-columns: 1fr; }
}

/* --- LAYOUT WRAPPER (Scroll အောင်မြင်ဖို့ အဓိက အပိုင်း) --- */

/* --- 1. GRID VIEW --- */

/* Grid Card style */
.grid-layout .card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: auto; /* အမြင့်ကို Content အလိုက်ပဲ ယူမယ် */
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

/* Card ထဲက စာသားနဲ့ ပုံ အပိုင်း */
.grid-layout .card-main-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 15px;
}

.grid-layout .card-icon-box {
    margin-bottom: 15px;
}

.grid-layout .card-text-box {
    padding: 0;
}

/* Actions Box (ခလုတ်တွေ) */
.grid-layout .card-action-box {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto; /* အပေါ်က အပိုင်းနဲ့ အကွာအဝေးကို ထိန်းမယ် */
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

/* --- 2. LIST VIEW --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-layout .card {
    flex-direction: row !important;
    padding: 15px 20px;
    align-items: center;
    height: 90px;
}

.list-layout .card-main-info {
    flex-direction: row;
    align-items: center;
}

.list-layout .card-icon-box {
    margin-right: 20px;
}

.list-layout .card-action-box {
    margin-left: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-area {
        padding-top: 80px; /* Sidebar အမြင့်ထက် ပိုထားပါ */
    }
    .grid-layout {
        grid-template-columns: 1fr; /* ဖုန်းမှာ တစ်တိုင်တည်းပြမယ် */
    }
}

/* --- SHARED CARD BASE (Grid ရော List ရောအတွက် အခြေခံ) --- */
.card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    display: flex;
    transition: 0.2s;
    cursor: pointer;
    overflow: visible !important; /* ခလုတ်တွေ မမြုပ်အောင် visible ထားမယ် */
}

/* --- GRID VIEW LAYOUT --- */
.grid-layout {
    display: grid !important;
    /* Column အကျယ်ကို ၂၅၀ ပဲထားမယ်၊ ဒါမှ နေရာလွတ်ရင် ၃ ခု၊ ၄ ခု စီသွားမှာပါ */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    align-items: start;
    width: 100%;
    align-content: start; /* Items တွေ အပေါ်ကစမယ် */
}

.grid-layout .card {
    flex-direction: column !important;
    padding: 20px;
}

.grid-layout .card-main-info {
    flex-direction: column;
    align-items: flex-start;
    flex: 1; /* စာသားတွေကို အပေါ်မှာ နေရာယူခိုင်းမယ် */
}

.grid-layout .card-icon-box {
    margin-bottom: 15px;
}

.grid-layout .card-action-box {
    display: flex !important; /* အတင်းပြခိုင်းမယ် */
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px; /* စာသားနဲ့ ခလုတ်ကြား အကွာအဝေး */
    padding-top: 12px;
    border-top: 1px solid #f1f5f9; /* မျဉ်းလေး တားမယ် */
    width: 100%;
}

/* --- LIST VIEW LAYOUT --- */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-layout .card {
    flex-direction: row !important;
    padding: 12px 20px;
    align-items: center;
    height: 85px;
}

.list-layout .card-action-box {
    margin-left: auto;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* --- BUTTON STYLES (ခလုတ်တွေ လှအောင်) --- */
.card-action-box button {
    background: #f8fafc;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.card-action-box button:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.btn-star.active {
    color: #f59e0b !important;
}

.btn-del:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

/* SCROLL FIX */
#data-list {
  width: 100%;
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 15px 15px 150px 15px;
    min-height: 0; /* Flex scroll fix */
}

/* Mobile အတွက် (ဖုန်းမှာတော့ ၁ တိုင်ပဲ ပြမယ်) */
@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) { /* 768 အစား 1024 ပြောင်းပါ */
  .sidebar {
    width: 100% !important;
    height: 65px !important;
    position: fixed;
    top: 0;
    left: 0;
    display: flex !important;
    flex-direction: row !important; /* ဘေးတိုက်စီမယ် */
    align-items: center;
    padding: 0 10px;
    z-index: 5000;
    background: linear-gradient(90deg, #001f16, #463100eb);
  }

  /* Menu တွေအားလုံး စုနေမယ့်နေရာ */
  .menu-container {
    display: flex !important;
    flex-direction: row !important; /* အပေါ်အောက်မဟုတ်ဘဲ ဘေးတိုက်စီမယ် */
    flex: 1;
    overflow-x: auto !important; /* ဘယ်ညာ scroll ဆွဲလို့ရအောင် */
    overflow-y: hidden;
    gap: 8px;
    padding: 0 10px;
    align-items: center;
    -webkit-overflow-scrolling: touch; /* iOS မှာ Scroll ချောအောင် */
  }

  /* Menu တစ်ခုချင်းစီ မကျုံ့သွားအောင် တားမယ် */
  .menu-item {
    flex-shrink: 0 !important; /* ဒါက အရေးကြီးဆုံးပါ (မပါရင် menu တွေ မြုပ်ကုန်တတ်ပါတယ်) */
    padding: 8px 15px !important;
    white-space: nowrap !important; /* စာသားတွေ အောက်မဆင်းစေရ */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    width: auto !important; /* ပုံေသအကျယ်မပေးဘဲ စာအလိုက် ယူခိုင်းမယ် */
  }

  .menu-item span {
    display: inline !important; /* ဖျောက်ထားမိရင် ပြန်ပြမယ် */
  }

  .brand, .menu-label, .user-details {
    display: none !important; /* ရှုပ်တဲ့စာတွေကို ဖျောက်မယ် */
  }

  .main-area {
    padding-top: 80px !important; /* content တွေ sidebar အောက် မမြုပ်အောင် */
    /* height: 100dvh; */
  }

  /* iPad မှာ Logout ခလုတ်ကို ညာဘက်အစွန်မှာ အသေကပ်ထားမယ် */
  .user-panel {
    margin-top: 0;
    background: none;
    padding: 0;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 10px;
  }

  .btn-mobile-logout {
    display: block !important;
    font-size: 22px; /* ခလုတ်ကို နှိပ်ရလွယ်အောင် ကြီးလိုက်မယ် */
    padding: 10px;
  }

  /* iPhone မှာ တစ်တိုင်တည်းပြမယ် (ညာဘက်မမြုပ်အောင်) */
  @media (max-width: 480px) {
    .grid-layout {
      grid-template-columns: 1fr !important;
    }
  }
}