/* MyCloud Admin Panel - Modern Apple-style Design */

/* Utility classes */
.hidden {
  display: none !important;
}

:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-sidebar: #1d1d1f;
  --bg-sidebar-hover: #2d2d2f;
  --bg-sidebar-active: #0071e3;
  
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-white: #ffffff;
  --text-muted: #6e6e73;
  
  --accent-blue: #0071e3;
  --accent-blue-hover: #0077ed;
  --accent-green: #34c759;
  --accent-red: #ff3b30;
  --accent-orange: #ff9500;
  --accent-purple: #af52de;
  --accent-teal: #5ac8fa;
  
  --border-color: #d2d2d7;
  --border-light: #e5e5e7;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #ffffff;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  color: var(--accent-blue);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-blue);
  color: var(--text-white);
}

.nav-link i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
}

.logout-btn i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.logout-btn:hover {
  background: rgba(255,59,48,0.1);
  color: var(--accent-red);
}

.sidebar-footer .nav-link:hover {
  background: rgba(255,59,48,0.1);
  color: var(--accent-red);
}

.logout-link:hover {
  background: rgba(255,59,48,0.1) !important;
  color: var(--accent-red) !important;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), #5856D6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* Main Content */
.main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.main-header {
  background: var(--bg-secondary);
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Top Header */
.top-header {
  background: var(--bg-secondary);
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Header Clock */
.header-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-clock i {
  color: var(--accent-blue);
  font-size: 16px;
}

/* Header Buttons */
.header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--accent-blue);
  color: white;
}

.chat-btn i {
  font-size: 18px;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-red);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.admin-profile i {
  font-size: 24px;
  color: var(--accent-blue);
}

.content-area {
  padding: 32px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 24px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(0,113,227,0.12); color: var(--accent-blue); }
.stat-icon.green { background: rgba(52,199,89,0.12); color: var(--accent-green); }
.stat-icon.orange { background: rgba(255,149,0,0.12); color: var(--accent-orange); }
.stat-icon.purple { background: rgba(175,82,222,0.12); color: var(--accent-purple); }
.stat-icon.teal { background: rgba(90,200,250,0.12); color: var(--accent-teal); }
.stat-icon.red { background: rgba(255,59,48,0.12); color: var(--accent-red); }

.stat-info {
  flex: 1;
}

.stat-info h3 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin: 0;
}

.stat-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

tbody td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--bg-primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* User Info Cell */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.user-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: rgba(52,199,89,0.12); color: #1d8348; }
.badge-warning { background: rgba(255,149,0,0.12); color: #b86e00; }
.badge-danger { background: rgba(255,59,48,0.12); color: #c0392b; }
.badge-info { background: rgba(0,113,227,0.12); color: var(--accent-blue); }
.badge-secondary { background: rgba(142,142,147,0.12); color: var(--text-secondary); }
.badge-primary { background: rgba(88,86,214,0.12); color: #5856d6; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-active { background: rgba(52,199,89,0.12); color: #1d8348; }
.status-cancelled { background: rgba(255,59,48,0.12); color: #c0392b; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-success {
  background: var(--accent-green);
  color: white;
}

.btn-danger {
  background: rgba(255,59,48,0.1);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(255,59,48,0.2);
}

.btn-warning {
  background: rgba(255,149,0,0.1);
  color: #ff9500;
}

.btn-warning:hover {
  background: rgba(255,149,0,0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Feature Input Group for Tariff Features */
.feature-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.feature-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.feature-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.1);
}

.btn-remove-feature {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: rgba(255,69,58,0.1);
  color: var(--status-cancelled);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-remove-feature:hover {
  background: rgba(255,69,58,0.2);
}

#tariff-features-container {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Action Buttons Group */
.action-btns {
  display: flex;
  gap: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f9f9fb;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0,113,227,0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

/* Modal */
.modal,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active,
.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

.modal-content.modal-lg {
  max-width: 700px;
}

@keyframes modalIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

/* Modal Container - for profile and password modals */
.modal-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalIn 0.3s ease;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-container .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.modal-container .modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.modal-container .modal-header h3 i {
  color: var(--accent-blue);
}

.modal-container .modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
  background: white;
}

.modal-container .modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-item label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-item p {
  font-size: 15px;
  color: var(--text-primary);
  margin: 0;
}

/* Utility Classes */
.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

.text-center {
  text-align: center;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo {
  justify-content: center;
  margin-bottom: 16px;
}

.login-logo {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 8px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-form .input-wrapper {
  position: relative;
}

.login-form .input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

.login-form .input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s ease;
  background: #f9f9fb;
}

.login-form .input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}

.login-form .input-wrapper input::placeholder {
  color: var(--text-muted);
}

.login-form .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

.alert-error {
  background: rgba(255,59,48,0.1);
  color: var(--accent-red);
  border: 1px solid rgba(255,59,48,0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Search & Filter Bar */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding-left: 42px;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 100;
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-primary);
}

.dropdown-item.danger {
  color: var(--accent-red);
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Checkbox Styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-color);
  appearance: none;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  display: block;
  text-align: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 14px;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

/* Phone link in tables */
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(0, 113, 227, 0.08);
  border-radius: 20px;
  transition: var(--transition);
}

.phone-link:hover {
  background: rgba(0, 113, 227, 0.15);
  color: var(--accent-blue-hover);
}

.phone-link i {
  font-size: 12px;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  font-weight: 500;
}

.toast-notification.show {
  transform: translateX(0);
}

.toast-notification i {
  font-size: 20px;
}

.toast-success {
  border-left: 4px solid var(--accent-green);
}

.toast-success i {
  color: var(--accent-green);
}

.toast-error {
  border-left: 4px solid var(--accent-red);
}

.toast-error i {
  color: var(--accent-red);
}

.toast-info {
  border-left: 4px solid var(--accent-blue);
}

.toast-info i {
  color: var(--accent-blue);
}

/* Confirm Dialog */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.confirm-overlay.show {
  opacity: 1;
}

.confirm-dialog {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.confirm-overlay.show .confirm-dialog {
  transform: scale(1);
}

.confirm-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 149, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.confirm-icon i {
  font-size: 32px;
  color: var(--accent-orange);
}

.confirm-message {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-buttons .btn {
  min-width: 120px;
}

/* Order Status Grid */
.order-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .order-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .order-stats-grid {
    grid-template-columns: 1fr;
  }
}

.order-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.order-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.order-stat-info h4 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.order-stat-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* Status colors */
.order-stat.pending .order-stat-icon {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
}

.order-stat.active .order-stat-icon {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.order-stat.completed .order-stat-icon {
  background: rgba(0, 122, 255, 0.15);
  color: #007aff;
}

.order-stat.cancelled .order-stat-icon {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.order-stat.pending { border-left: 4px solid #ff9500; }
.order-stat.active { border-left: 4px solid #34c759; }
.order-stat.completed { border-left: 4px solid #007aff; }
.order-stat.cancelled { border-left: 4px solid #ff3b30; }

/* Permissions Grid */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.permission-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  transition: var(--transition);
}

.permission-item:hover {
  border-color: var(--accent-blue);
  background: rgba(0, 113, 227, 0.04);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-label .checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.checkbox-label i {
  color: var(--text-secondary);
  font-size: 16px;
}

/* Permission badges in table */
.perm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.perm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent-blue);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* ============ PROFESSIONAL ADMIN MODAL ============ */

/* Form Sections */
.form-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.section-title i {
  color: var(--accent-blue);
  font-size: 18px;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Required asterisk */
.required {
  color: #ff3b30;
}

/* Input with icon */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > i:first-child {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  font-size: 16px;
  z-index: 1;
}

.input-with-icon input {
  padding-left: 42px !important;
  width: 100%;
}

.password-input input {
  padding-right: 45px !important;
}

/* Toggle password visibility */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--accent-blue);
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strength-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.strength-fill.weak { width: 25%; background: linear-gradient(90deg, #ff3b30, #ff6b6b); }
.strength-fill.fair { width: 50%; background: linear-gradient(90deg, #ff9500, #ffb347); }
.strength-fill.good { width: 75%; background: linear-gradient(90deg, #34c759, #7ed957); }
.strength-fill.strong { width: 100%; background: linear-gradient(90deg, #007aff, #5ac8fa); }

.strength-text {
  font-size: 12px;
  font-weight: 500;
}

.strength-fill.weak + .strength-text, 
.strength-text.weak { color: #ff3b30; }
.strength-fill.fair + .strength-text,
.strength-text.fair { color: #ff9500; }
.strength-fill.good + .strength-text,
.strength-text.good { color: #34c759; }
.strength-fill.strong + .strength-text,
.strength-text.strong { color: #007aff; }

/* Password Match */
.password-match {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-match.match {
  color: #34c759;
}

.password-match.no-match {
  color: #ff3b30;
}

.password-match i {
  font-size: 14px;
}

/* Form hint */
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Toggle Switch */
.status-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e5ea;
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: #34c759;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Select All Button */
.select-all-btn {
  margin-top: 16px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-primary);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Modal Large */
.modal-content.modal-lg {
  max-width: 720px;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

/* ============ PERMISSION CARDS ============ */

.permission-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.permission-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.08);
}

.permission-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

.permission-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.permission-card-title i {
  color: var(--accent-blue);
  font-size: 16px;
}

/* Mini Toggle */
.mini-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.mini-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mini-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e5ea;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.mini-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.mini-toggle input:checked + .mini-slider {
  background: #34c759;
}

.mini-toggle input:checked + .mini-slider::before {
  transform: translateX(20px);
}

/* Permission Card Body */
.permission-card-body {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  transition: all 0.3s ease;
}

.permission-card-body.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Permission Checkbox */
.perm-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.perm-checkbox:hover {
  border-color: var(--accent-blue);
  background: rgba(0, 113, 227, 0.04);
}

.perm-checkbox input {
  display: none;
}

.perm-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.perm-checkbox input:checked + .perm-check {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.perm-checkbox input:checked + .perm-check::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: bold;
}

.perm-checkbox input:checked ~ i,
.perm-checkbox:has(input:checked) {
  color: var(--accent-blue);
}

.perm-checkbox i {
  font-size: 14px;
}

/* View permission - green */
.perm-checkbox:has(#perm_dashboard_view:checked),
.perm-checkbox:has([id$="_view"]:checked) {
  background: rgba(52, 199, 89, 0.08);
  border-color: rgba(52, 199, 89, 0.3);
}

.perm-checkbox:has([id$="_view"]:checked) i {
  color: #34c759;
}

/* Edit permission - orange */
.perm-checkbox:has([id$="_edit"]:checked) {
  background: rgba(255, 149, 0, 0.08);
  border-color: rgba(255, 149, 0, 0.3);
}

.perm-checkbox:has([id$="_edit"]:checked) i {
  color: #ff9500;
}

/* Delete permission - red */
.perm-checkbox:has([id$="_delete"]:checked) {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.3);
}

.perm-checkbox:has([id$="_delete"]:checked) i {
  color: #ff3b30;
}

/* Permission Actions */
.permission-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* Permission Badges in Table */
.perm-badges-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.perm-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 12px;
}

.perm-badge-name {
  font-weight: 500;
  color: var(--text-primary);
}

.perm-badge-icons {
  display: flex;
  gap: 6px;
}

.perm-badge-icons i {
  font-size: 12px;
}

.perm-badge-icons i.bi-eye {
  color: #34c759;
}

.perm-badge-icons i.bi-pencil {
  color: #ff9500;
}

.perm-badge-icons i.bi-trash {
  color: #ff3b30;
}

.perm-badge-icons i.bi-check-all {
  color: var(--accent-blue);
}

/* New Beautiful Permission Styles */
.permissions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 280px;
}

.perm-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 1px solid #e9ecef;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.perm-badge-row:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.perm-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.perm-badge-header i {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--menu-color, #007AFF);
  color: white;
  border-radius: 6px;
  font-size: 12px;
}

.perm-badge-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.perm-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.perm-icon:hover {
  transform: scale(1.15);
}

.perm-icon.view {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.perm-icon.edit {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
}

.perm-icon.delete {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.perm-icon.all {
  background: rgba(0, 122, 255, 0.15);
  color: #007AFF;
}

.no-permissions {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px;
}

/* Compact Permission Chips - Horizontal */
.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
}

.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: linear-gradient(135deg, rgba(var(--chip-color-rgb, 0,122,255), 0.1) 0%, rgba(var(--chip-color-rgb, 0,122,255), 0.05) 100%);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  font-size: 12px;
  cursor: default;
  transition: all 0.2s ease;
}

.perm-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.perm-chip > i:first-child {
  color: var(--chip-color, #007AFF);
  font-size: 13px;
}

.perm-chip .perm-v {
  color: #34C759;
  font-size: 10px;
}

.perm-chip .perm-e {
  color: #FF9500;
  font-size: 10px;
}

.perm-chip .perm-d {
  color: #FF3B30;
  font-size: 10px;
}

.perm-chip .perm-a {
  color: #007AFF;
  font-size: 11px;
}

.no-perm {
  color: var(--text-muted);
  font-size: 13px;
}

/* Admin Profile Dropdown */
.admin-dropdown {
  position: relative;
}

.admin-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-profile-btn:hover {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.admin-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.admin-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.admin-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.admin-dropdown.open .admin-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.dropdown-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
}

.dropdown-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.dropdown-role {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

.dropdown-item:hover {
  background: var(--bg-primary);
}

.dropdown-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--text-muted);
}

.dropdown-item.logout-item {
  color: #FF3B30;
}

.dropdown-item.logout-item i {
  color: #FF3B30;
}

/* Profile Modal Styles */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
}

.profile-avatar-info h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.profile-avatar-info .text-muted {
  font-size: 13px;
  color: var(--text-muted);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-match {
  margin-top: 6px;
  font-size: 12px;
  min-height: 18px;
}

.password-match.match {
  color: #34C759;
}

.password-match.no-match {
  color: #FF3B30;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
