/* ========================================
   MATERIAL DESIGN 3 - MODAL / DIALOG STYLES
   Abie Messenger
   ======================================== */

/* ========================================
   MODAL BACKDROP (Scrim)
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-index-modal, 1000);
  animation: md-fade-in var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

/* ========================================
   MODAL CONTENT (Dialog)
   ======================================== */
.modal-content {
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-extra-large);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: md-scale-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate);
  box-shadow: var(--md-sys-elevation-level3);
}

.modal-small {
  max-width: 400px;
}

.modal-medium {
  max-width: 600px;
}

.modal-large {
  max-width: 1000px;
  height: 85vh;
}

/* ========================================
   MODAL HEADER
   ======================================== */
.modal-header {
  padding: 24px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--md-sys-typescale-headline-small-font-family);
  font-size: var(--md-sys-typescale-headline-small-font-size);
  font-weight: 500;
  line-height: var(--md-sys-typescale-headline-small-line-height);
  color: var(--md-sys-color-on-surface);
}

/* ========================================
   CLOSE BUTTON (Icon Button)
   ======================================== */
.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-full);
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  position: relative;
}

.close-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.close-btn:hover::before {
  opacity: var(--md-sys-state-hover-opacity);
}

.close-btn:active::before {
  opacity: var(--md-sys-state-pressed-opacity);
}

/* ========================================
   MODAL BODY
   ======================================== */
.modal-body {
  padding: 0 24px 24px;
  overflow-y: auto;
  flex: 1;
}

/* ========================================
   MANAGEMENT CONTAINER
   ======================================== */
.management-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ========================================
   MANAGEMENT SIDEBAR (Navigation Rail)
   ======================================== */
.management-sidebar {
  width: 220px;
  background: var(--md-sys-color-surface-container);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  border-right: 1px solid var(--md-sys-color-outline-variant);
}

.management-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-full);
  transition:
    background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  position: relative;
}

.management-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.management-nav-btn:hover::before {
  opacity: var(--md-sys-state-hover-opacity);
}

.management-nav-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.management-nav-btn.active::before {
  opacity: 0;
}

.management-nav-btn .nav-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.management-nav-btn .nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   MANAGEMENT CONTENT
   ======================================== */
.management-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--md-sys-color-surface-container-lowest);
}

.management-section {
  display: none;
}

.management-section.active {
  display: block;
  animation: md-fade-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

/* ========================================
   SECTION HEADER
   ======================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.section-header h3 {
  margin: 0;
  font-family: var(--md-sys-typescale-title-large-font-family);
  font-size: var(--md-sys-typescale-title-large-font-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-success {
  padding: 10px 24px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  cursor: pointer;
  transition:
    box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.btn-success::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.btn-success:hover {
  box-shadow: var(--md-sys-elevation-level1);
}

.btn-success:hover::before {
  opacity: var(--md-sys-state-hover-opacity);
}

.btn-success:active {
  transform: scale(0.98);
}

/* ========================================
   USERS TABLE
   ======================================== */
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
}

.users-table th,
.users-table td {
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.users-table th {
  background: var(--md-sys-color-surface-container);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.users-table td {
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface);
}

.users-table tr:hover td {
  background: var(--md-sys-color-surface-container-low);
}

.users-table tr:last-child td {
  border-bottom: none;
}

/* ========================================
   ROLE SELECT (Dropdown)
   ======================================== */
.role-select {
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  cursor: pointer;
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.role-select:hover {
  border-color: var(--md-sys-color-on-surface);
}

.role-select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 7px 11px;
}

/* ========================================
   USERS FILTERS
   ======================================== */
.users-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.users-filters .search-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-body-large-font-family);
  font-size: var(--md-sys-typescale-body-large-font-size);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.users-filters .search-input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
}

.users-filters .search-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 11px 15px;
}

.users-filters .role-filter {
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-body-large-font-family);
  font-size: var(--md-sys-typescale-body-large-font-size);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  min-width: 160px;
  transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.users-filters .role-filter:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 0;
}

.pagination-controls button {
  padding: 10px 20px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  transition:
    background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
    border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--md-sys-color-secondary-container);
  border-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary-container);
}

.pagination-controls button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pagination-controls .pagination-info {
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
}

/* ========================================
   PROFILE MODAL STYLES
   ======================================== */
.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-level2);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-large .avatar-initials {
  color: var(--md-sys-color-on-primary-container);
  font-family: var(--md-sys-typescale-display-small-font-family);
  font-size: 42px;
  font-weight: 500;
}

.profile-info {
  width: 100%;
  text-align: center;
}

.profile-name {
  font-family: var(--md-sys-typescale-headline-medium-font-family);
  font-size: var(--md-sys-typescale-headline-medium-font-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 4px;
}

.profile-login {
  font-family: var(--md-sys-typescale-body-large-font-family);
  font-size: var(--md-sys-typescale-body-large-font-size);
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px;
}

.profile-phone-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

#profilePhone {
  font-family: var(--md-sys-typescale-body-large-font-family);
  font-size: var(--md-sys-typescale-body-large-font-size);
  color: var(--md-sys-color-on-surface);
}

#profilePhone.phone-placeholder {
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
}

.phone-link {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.phone-link:hover {
  color: var(--md-sys-color-tertiary);
  text-decoration: underline;
}

.edit-phone-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.edit-phone-btn:hover {
  background: var(--md-sys-color-surface-container-highest);
}

.profile-phone-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-phone-edit input {
  padding: 10px 16px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--md-sys-typescale-body-large-font-family);
  font-size: var(--md-sys-typescale-body-large-font-size);
  width: 180px;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-lowest);
  transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.profile-phone-edit input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
}

.profile-role {
  display: inline-block;
  padding: 8px 20px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  margin-bottom: 12px;
}

.profile-position,
.profile-store {
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 4px;
}

/* ========================================
   SMALL BUTTONS
   ======================================== */
.btn-primary-small,
.btn-secondary-small {
  padding: 8px 16px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  cursor: pointer;
  transition:
    background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.btn-primary-small {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-primary-small:hover {
  box-shadow: var(--md-sys-elevation-level1);
}

.btn-secondary-small {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.btn-secondary-small:hover {
  background: var(--md-sys-color-surface-container-high);
}

/* ========================================
   DELETE BUTTON
   ======================================== */
.btn-delete {
  padding: 8px 16px;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  cursor: pointer;
  transition:
    background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.btn-delete:hover {
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

/* ========================================
   PASSWORD BUTTON
   ======================================== */
.btn-password {
  padding: 8px 16px;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  cursor: pointer;
  transition:
    background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.btn-password:hover {
  background: var(--md-sys-color-tertiary);
  color: var(--md-sys-color-on-tertiary);
}

/* ========================================
   MODAL CLOSING ANIMATION
   ======================================== */
.modal.closing {
  animation: md-fade-out var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-accelerate) forwards;
  pointer-events: none;
}

.modal.closing .modal-content {
  animation: md-scale-out var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-accelerate) forwards;
}

/* ========================================
   REVENUE DASHBOARD
   ======================================== */
.revenue-deadline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-large);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  text-align: center;
  line-height: 1.3;
}

.revenue-deadline.deadline-ok {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.revenue-deadline.deadline-warning {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  animation: pulse-warning 1.5s ease-in-out infinite;
}

.revenue-deadline.deadline-passed {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.revenue-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.revenue-stat {
  flex: 1;
  min-width: 200px;
  padding: 20px 24px;
  background: var(--md-sys-color-primary-container);
  border-radius: var(--md-sys-shape-corner-large);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.revenue-stat-value {
  font-family: var(--md-sys-typescale-headline-medium-font-family);
  font-size: var(--md-sys-typescale-headline-medium-font-size);
  font-weight: 500;
  color: var(--md-sys-color-on-primary-container);
}

.revenue-stat-label {
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-primary-container);
  opacity: 0.8;
}

.revenue-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  margin-bottom: 24px;
}

.revenue-table th,
.revenue-table td {
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.revenue-table th {
  background: var(--md-sys-color-surface-container);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  color: var(--md-sys-color-on-surface-variant);
}

.revenue-table td {
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  color: var(--md-sys-color-on-surface);
}

.revenue-table tr:hover td {
  background: var(--md-sys-color-surface-container-low);
}

.revenue-table tr:last-child td {
  border-bottom: none;
}

.revenue-table .amount {
  font-weight: 500;
  font-family: var(--md-sys-typescale-title-medium-font-family);
}

.revenue-table .amount.has-value {
  color: var(--md-sys-color-primary);
}

.revenue-table .amount.no-value {
  color: var(--md-sys-color-on-surface-variant);
}

.revenue-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-medium-font-family);
  font-size: var(--md-sys-typescale-label-medium-font-size);
  font-weight: var(--md-sys-typescale-label-medium-font-weight);
}

.revenue-status .status-icon {
  font-size: 14px;
}

.revenue-status .status-text {
  white-space: nowrap;
}

.revenue-status.status-sent {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

.revenue-status.status-pending {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.revenue-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.btn-icon:hover {
  background: var(--md-sys-color-secondary-container);
}

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

.revenue-actions .btn-secondary {
  padding: 12px 24px;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.revenue-actions .btn-secondary:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* ========================================
   REVENUE SUBTABS
   ======================================== */
.revenue-subtabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
  width: fit-content;
}

.revenue-actions .revenue-subtabs {
  margin-bottom: 0;
}

.revenue-subtab {
  padding: 10px 20px;
  min-width: 100px;
  background: transparent;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-large-font-family);
  font-size: var(--md-sys-typescale-label-large-font-size);
  font-weight: var(--md-sys-typescale-label-large-font-weight);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  text-align: center;
  white-space: nowrap;
}

.revenue-subtab:hover {
  background: var(--md-sys-color-surface-container-high);
}

.revenue-subtab.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.revenue-subtab-content {
  display: none;
}

.revenue-subtab-content.active {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  animation: md-fade-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.revenue-subtab-content .revenue-actions {
  margin-top: auto;
  padding-top: 24px;
}

@keyframes md-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   STATISTICS FILTERS
   ======================================== */
.stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-end;
}

.stats-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-filter-group label {
  font-family: var(--md-sys-typescale-label-medium-font-family);
  font-size: var(--md-sys-typescale-label-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
}

.stats-period-buttons,
.stats-chart-type-buttons {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
}

.stats-period-btn,
.stats-chart-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: var(--md-sys-typescale-label-medium-font-family);
  font-size: var(--md-sys-typescale-label-medium-font-size);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.stats-period-btn:hover,
.stats-chart-btn:hover {
  background: var(--md-sys-color-surface-container-high);
}

.stats-period-btn.active,
.stats-chart-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.stats-store-select {
  padding: 10px 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--md-sys-typescale-body-medium-font-family);
  font-size: var(--md-sys-typescale-body-medium-font-size);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  min-width: 180px;
}

.stats-store-select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
}

/* ========================================
   STATISTICS SUMMARY CARDS
   ======================================== */
.stats-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stats-card {
  flex: 1;
  min-width: 150px;
  padding: 16px 20px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-large);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-card-value {
  font-family: var(--md-sys-typescale-headline-small-font-family);
  font-size: var(--md-sys-typescale-headline-small-font-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.stats-card-value.trend-up {
  color: var(--md-sys-color-tertiary);
}

.stats-card-value.trend-down {
  color: var(--md-sys-color-error);
}

.stats-card-label {
  font-family: var(--md-sys-typescale-body-small-font-family);
  font-size: var(--md-sys-typescale-body-small-font-size);
  color: var(--md-sys-color-on-surface-variant);
}

/* ========================================
   CHART CONTAINER
   ======================================== */
.stats-chart-container {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 20px;
  height: 400px;
  position: relative;
}

/* ========================================
   CLICKABLE STORE NAME
   ======================================== */
.revenue-row-clickable {
  cursor: pointer;
}

.store-name-link {
  color: var(--md-sys-color-primary);
  cursor: pointer;
  transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.store-name-link:hover {
  color: var(--md-sys-color-tertiary);
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  /* Навигация управления - только иконки */
  .management-sidebar {
    width: 60px;
    padding: 12px 4px;
  }

  .management-nav-btn {
    justify-content: center;
    padding: 14px;
  }

  .management-nav-btn .nav-text {
    display: none;
  }

  .management-nav-btn .nav-icon {
    font-size: 24px;
  }

  /* Статусы - только иконки */
  .revenue-status .status-text {
    display: none;
  }

  .revenue-status .status-icon {
    font-size: 18px;
  }

  .revenue-status {
    padding: 8px 10px;
  }

  /* Дедлайн */
  .revenue-deadline {
    font-size: 12px;
    padding: 6px 12px;
  }

  .revenue-subtab-content.active {
    min-height: 400px;
  }

  .revenue-actions {
    flex-direction: column;
    gap: 16px;
  }

  .revenue-subtabs {
    width: 100%;
    justify-content: center;
  }

  .revenue-subtab {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .revenue-actions-buttons {
    justify-content: center;
  }

  .stats-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-period-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stats-period-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .stats-chart-container {
    height: 280px;
    padding: 12px;
  }

  .stats-summary {
    flex-direction: column;
  }

  .stats-store-select {
    width: 100%;
    min-width: auto;
  }

  .revenue-table {
    font-size: 12px;
  }

  .revenue-table th,
  .revenue-table td {
    padding: 10px 6px;
  }

  .revenue-summary {
    gap: 12px;
  }

  .revenue-stat {
    min-width: auto;
    padding: 16px;
  }

  /* Скрыть столбец "Отправил" на мобильных */
  .revenue-table th:nth-child(3),
  .revenue-table td:nth-child(3) {
    display: none;
  }

  .stats-card {
    min-width: auto;
  }
}
