/* ECOPlan - Main Styles */
/* Modern minimalist design  */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-gray-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* Layout Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-gray-100);
}

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  box-shadow: var(--shadow-sm);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
}

.app-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-weight-bold);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* Sidebar Navigation */
.app-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--bg-white);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  transition: transform var(--transition-base);
  z-index: var(--z-fixed);
}

.sidebar-nav {
  padding: var(--spacing-lg) 0;
}

.nav-section {
  margin-bottom: var(--spacing-xl);
}

.nav-section-title {
  padding: 0 var(--spacing-lg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  gap: var(--spacing-md);
}

.nav-item:hover {
  background-color: var(--bg-gray-50);
  color: var(--primary-color);
}

.nav-item.active {
  background-color: rgba(46, 125, 50, 0.08);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: var(--font-weight-medium);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  /* margin-right: var(--notification-width); */
  margin-top: var(--header-height);
  padding: var(--spacing-xl);
  min-height: calc(100vh - var(--header-height));
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* Notification Panel - Persistent Right Column */
.notification-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--notification-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--bg-gray-50);
  border-left: 1px solid var(--border-color);
  z-index: 500;
  overflow-y: auto;
  padding: var(--spacing-lg);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
}

.notification-panel.collapsed {
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

.notification-panel-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.notification-badge {
  background-color: var(--error-color);
  color: var(--text-white);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.notification-item {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-left: 4px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.notification-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(-2px);
}

.notification-item.unread {
  background-color: #f0f7ff;
}

.notification-item.level1 {
  border-left-color: var(--warning-color);
}

.notification-item.level2 {
  border-left-color: var(--error-color);
}

.notification-item.level3 {
  border-left-color: #b71c1c;
}

.notification-item.info {
  border-left-color: var(--info-color);
}

.notification-item.success {
  border-left-color: var(--success-color);
}

.notification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-xs);
}

.notification-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.notification-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-color);
  margin-left: var(--spacing-sm);
  flex-shrink: 0;
}

.notification-message {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: var(--spacing-xs) 0;
  line-height: var(--line-height-relaxed);
}

.notification-time {
  font-size: var(--font-size-xs);
  color: var(--text-disabled);
  margin-top: var(--spacing-xs);
}

.notification-empty {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--text-disabled);
}

.notification-empty i {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.3;
}

/* Cards */
.card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.card-header {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: var(--spacing-xl);
}

.card-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-gray-50);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-white);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-white);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--secondary-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: var(--text-white);
}

.btn-danger {
  background-color: var(--error-color);
  color: var(--text-white);
}

.btn-danger:hover:not(:disabled) {
  background-color: #b71c1c;
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-size-lg);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success {
  background-color: rgba(46, 125, 50, 0.12);
  color: var(--success-color);
}

.badge-warning {
  background-color: rgba(245, 124, 0, 0.12);
  color: var(--warning-color);
}

.badge-error {
  background-color: rgba(211, 47, 47, 0.12);
  color: var(--error-color);
}

.badge-info {
  background-color: rgba(2, 136, 209, 0.12);
  color: var(--info-color);
}

/* Status Indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-green {
  background-color: var(--status-green);
}

.status-yellow {
  background-color: var(--status-yellow);
}

.status-red {
  background-color: var(--status-red);
}

/* Footer */
.app-footer {
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg) var(--spacing-xl);
  margin-left: var(--sidebar-width);
  margin-right: var(--notification-width);
  margin-top: var(--spacing-2xl);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-links {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.footer-link:hover {
  color: var(--primary-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: var(--font-size-sm); }
.text-bold { font-weight: var(--font-weight-bold); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* Responsive */
@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    margin-right: 0;
  }

  .app-footer {
    margin-left: 0;
    margin-right: 0;
  }

  .notification-panel {
    transform: translateX(100%);
  }

  .notification-panel.open {
    transform: translateX(0);
  }

  :root {
    --sidebar-width: 100%;
    --notification-width: 100%;
  }
}

    .sidebar-toggle-btn {
      display: none;
      margin-right: 10px;
      border-radius: 10px;
      padding: 6px 10px;
    }

    /* Overlay (soft, elegant) */
    .sidebar-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .35);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      z-index: 998;
      display: none;
    }

    /* Off-canvas sidebar – minimal, auto width */
    @media (max-width: 768px) {
      .sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, .06);
        border: 1px solid rgba(0, 0, 0, .08);
      }

      /* Make sidebar a “floating card” */
      .app-sidebar {
        position: fixed;
        top: 12px;
        left: 12px;

        /* only as wide as content, but not huge */
        width: fit-content;
        min-width: 220px;
        max-width: min(86vw, 320px);

        height: auto;
        max-height: calc(100vh - 24px);
        overflow: auto;

        border-radius: 16px;
        box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
        border: 1px solid rgba(0, 0, 0, .08);

        transform: translateX(calc(-100% - 24px));
        transition: transform .18s ease;

        z-index: 999;
      }

      body.sidebar-open .app-sidebar {
        transform: translateX(0);
      }

      body.sidebar-open .sidebar-overlay {
        display: block;
      }

      /* Make nav spacing cleaner on mobile */
      .sidebar-nav {
        padding: 8px;
      }

      .nav-section-title {
        opacity: .7;
        font-size: 12px;
        letter-spacing: .02em;
        margin: 8px 10px;
      }

      .nav-item {
        border-radius: 12px;
        padding: 10px 12px;
        margin: 4px 0;
        gap: 10px;
      }

      .nav-item-icon {
        opacity: .9;
      }

      .nav-item:first-child {
        margin-top: 20px;
      }

      /* Active item: subtle highlight, not loud */
      .nav-item.active {
        background: rgba(0, 0, 0, .06);
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
      }

      /* Hover: very gentle */
      .nav-item:hover {
        background: rgba(0, 0, 0, .04);
      }
    }

    /* --- Break Countdown Pill (Navbar) --- */
.break-pill{
  display:flex;
  align-items:center;
  gap:.45rem;
  padding:.35rem .55rem;
  border-radius:999px;

  background: rgba(255,255,255,.75);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color:#0f172a;
  user-select:none;
  white-space:nowrap;
}

.break-dot{
  width:.55rem;
  height:.55rem;
  border-radius:999px;
  background:#86efac; /* soft green */
  box-shadow: 0 0 0 3px rgba(134,239,172,.22);
}

.timer-dot{
  width:.55rem;
  height:.55rem;
  border-radius:999px;
  background:#86efac; /* soft green */
  box-shadow: 0 0 0 3px rgba(134,239,172,.22);
}

.break-label{
  font-size:.85rem;
  font-weight:600;
  opacity:.8;
  margin-left:.1rem;
}

.break-btn{
  width:32px;
  height:28px;
  border:0;
  border-radius:10px;
  background: transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#0f172a;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
  padding:0;
}

.break-btn:hover{
  background: rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.break-btn:active{ transform: translateY(0); }

.break-btn:disabled{
  opacity:.35;
  pointer-events:none;
}

.break-stop{
  color:#f97316; /* modern orange */
}
.timer-stop{
  color:#f97316; /* modern orange */
}

.break-time{
  font-variant-numeric: tabular-nums;
  font-size:.9rem;
  font-weight:700;
  letter-spacing:.02em;
  padding-left:.25rem;
  padding-right:.15rem;
}

/* Running state */
.break-pill.is-running{
  border-color: rgba(249,115,22,.28);
  box-shadow: 0 14px 40px rgba(249,115,22,.12);
}

.break-pill.is-running .break-dot{
  background:#fdba74; /* soft orange */
  box-shadow: 0 0 0 3px rgba(253,186,116,.25);
}

.break-pill.is-running .timer-dot{
  background:#fdba74; /* soft orange */
  box-shadow: 0 0 0 3px rgba(253,186,116,.25);
}

/* Mobile: keep it compact */
@media (max-width: 576px){
  .break-pill{ padding:.3rem .45rem; gap:.35rem; }
  .break-time{ font-size:.85rem; }
}

.cursor-pointer{
    cursor: pointer;
}


@media print {
    .page-break {
        page-break-before: always;
    }
}

.btn:disabled{
    background-color: #198754;
}

/* Custom Tables Section Styling */
.custom-tables-section {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 20px;
}

/* Horizontal scroll container */
#customTablesContainer {
    width: 100%;
}

.custom-table-wrapper .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.custom-table-wrapper .card-body::-webkit-scrollbar {
    height: 8px;
}

.custom-table-wrapper .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-table-wrapper .card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-table-wrapper .card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.custom-data-table {
    min-width: max-content; /* Prevents table from shrinking */
    width: 100%;
}

.custom-data-table th,
.custom-data-table td {
    min-width: 150px; /* Minimum column width */
    white-space: nowrap;
}

.custom-data-table .row-actions {
    min-width: 50px !important;
    width: 50px;
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

.custom-tables-section .section-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.custom-tables-section .section-header h5 {
    color: #495057;
    font-weight: 600;
}

.custom-table-wrapper {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.custom-table-wrapper .card-header {
    color: white;
    padding: 10px 15px;
    border-bottom: none;
}

.custom-table-wrapper .table-name-input {
    background: rgba(255,255,255,0.9);
    border: none;
    font-weight: 600;
    color: #333;
}

.custom-table-wrapper .table-name-input:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.custom-table-wrapper .table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-table-wrapper .table-actions .btn {
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 10px;
}

.custom-table-wrapper .card-body {
    padding: 15px;
    background: #fafbfc;
}

.custom-data-table {
    margin-bottom: 0;
    background: white;
}

.custom-data-table thead {
    background: #e9ecef;
}

.custom-data-table th {
    padding: 8px;
    vertical-align: middle;
}

.custom-data-table th .d-flex {
    gap: 5px;
}

.custom-data-table .header-input {
    font-weight: 600;
    background: #fff;
    border: 1px solid #ced4da;
}



.custom-data-table td {
    padding: 6px 8px;
    vertical-align: middle;
}

.custom-data-table .cell-input {
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}



.custom-data-table .cell-input:hover {
    border-color: #adb5bd;
}

.custom-data-table .row-actions {
    width: 50px;
    text-align: center;
    vertical-align: middle;
}

.custom-data-table .remove-col-btn,
.custom-data-table .remove-row-btn {
    padding: 2px 6px;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.custom-data-table th:hover .remove-col-btn,
.custom-data-table tr:hover .remove-row-btn {
    opacity: 1;
}

.custom-data-table .remove-col-btn:hover,
.custom-data-table .remove-row-btn:hover {
    background-color: #86efac;
    color: white;
    border-color: #86efac;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-table-wrapper .card-header {
        flex-direction: column;
        gap: 10px;
    }

    .custom-table-wrapper .table-name-input {
        max-width: 100% !important;
    }

    .custom-table-wrapper .table-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Animation for adding new tables/rows */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-table-wrapper {
    animation: fadeIn 0.3s ease;
}

/* Empty state */
#customTablesContainer:empty::after {
    content: 'No custom tables added yet. Click "Add New Table" to create one.';
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}


/* table show css */

.custom-tables-display {
    margin-top: 20px;
}

.custom-tables-display > h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.custom-table-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.custom-table-header {
    background: #81c784;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
}

.custom-table-header .table-name {
    font-size: 16px;
}

.custom-table-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table-body::-webkit-scrollbar {
    height: 8px;
}

.custom-table-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-table-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-table-card .table {
    margin-bottom: 0;
    min-width: max-content;
}

.custom-table-card .table thead {
    background: #f8f9fa;
}

.custom-table-card .table th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    min-width: 120px;
}

.custom-table-card .table td {
    white-space: nowrap;
    min-width: 120px;
}

.custom-table-card .table tbody tr:hover {
    background-color: #f1f3f4;
}

