  body {
    background-color: #121214;
    color: #e1e1e6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  /* FORMS AUTHENTICATION, REGISTRATION, FORGOT */
  .auth-container, .form-card {
    max-width: 420px;
    margin: 60px auto;
    padding: 32px;
    background-color: #202024;
    border: 1px solid #29292e;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }


  h1, h2, h3 {
    color: #f7f7f8;
    font-weight: 600;
    margin-top: 0;
  }

  input[type="email"],
  input[type="password"],
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0 20px 0;
    background-color: #121214;
    border: 1px solid #29292e;
    border-radius: 8px;
    color: #f7f7f8;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
  }

  input:focus {
    outline: none;
    border-color: #f59e0b;
  }

  label {
    font-size: 14px;
    color: #a8a8b3;
    font-weight: 500;
  }

  button, input[type="submit"], .btn-primary {
    background-color: #f59e0b;
    color: #121214;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
  }

  button:hover, input[type="submit"]:hover, .btn-primary:hover {
    background-color: #d97706;
  }

  a, a:visited {
    color: #f59e0b;
    text-decoration: none;
    font-size: 14px;
  }

  .auth-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .auth-links-center {
    margin-top: 20px;
    text-align: center;
  }

  /* ALERT, NOTICE, EXPLANATION */
  .flash-alert {
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
  }

  .flash-notice {
    color: #34d399;
    background-color: rgba(52, 211, 153, 0.1);
    border: 1px solid #34d399;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
  }


  .error-explanation {
    color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid #f87171;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
  }

  .error-explanation p {
    margin: 0 0 8px 0;
    font-weight: 600;
  }

  .error-explanation ul {
    margin: 0;
    padding-left: 20px;
  }

  /* NAVBAR */
  .app-navbar {
    background-color: #0f172a;
    border-bottom: 1px solid #1e293b;
    padding: 16px 0;
    margin-bottom: 5px;
  }

  .navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .navbar-links {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .navbar-brand {
    color: #f8fafc;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
  }

  .navbar-brand:hover {
    color: #f8fafc;
  }

  .navbar-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
  }

  .navbar-link:hover {
    color: #f8fafc;
  }

  .btn-logout {
    background-color: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-logout:hover {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #475569;
  }

  /* DEVICE INDEX,  EDIT */
  .dashboard-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
  }

  .dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    
  }

  .dashboard-title {
    color: #f8fafc;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
  }

  .content-header {
    max-width: 800px;
    margin: 0 auto 20px auto;
  }

  .content-header h1 {
    font-size: 24px;
    margin: 0;
  }

  .devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .device-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, transform 0.2s ease;
  }

  .device-card:hover {
    border-color: #475569;
    transform: translateY(-2px);
  }

  .device-card p {
    color: #94a3b8;
    margin: 8px 0;
    font-size: 14px;
  }

  .device-card strong, .device-card b {
    color: #e2e8f0;
  }

  .device-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #334155;
  }

  .btn-primary {
    background-color: #f59e0b !important;
    color: #0f172a !important;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700 !important;
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    transition: background-color 0.2s;
    display: inline-block;
  }

  .btn-primary:hover {
    background-color: #d97706;
  }

  .btn-secondary {
    color: #f59e0b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
  }

  .dashboard-header .btn-primary {
    width: auto; 
  }

  /* DEVICE SHOW */
  .device-details-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    margin: 0 auto;
  }

  .back-link-container {
    margin-bottom: 30px;
  }
  .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    color: #94a3b8; /* Elegancki, stonowany szary/niebieski */
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
  }

  .btn-back:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #f8fafc; /* Rozjaśnienie tekstu na biało po najechaniu */
    border-color: #475569;
    text-decoration: none;
  }

  .api-key-box {
    margin-top: 20px;
    padding: 16px;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
  }

  .api-key-box code {
    color: #34d399;
    font-family: monospace;
    font-size: 14px;
  }

  .device-show-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }

 
  .btn-danger {
    background-color: transparent !important;
    color: #ef4444 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    cursor: pointer;
    box-shadow: none !important;
    display: inline !important;
    text-decoration: none !important; 
  }

  .btn-danger:hover {
    background-color: transparent !important;
    color: #dc2626 !important;
    text-decoration: none !important;
  }

  /* MEASUREMENTS INDEX */
  .measurement-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
  }

  .table-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; 
    border-radius: 12px;
    position: relative; 
  }
  /* TABELS */
  .measurements-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
  }

  .measurements-table th {
    position: sticky;
    top: 0;
    background-color: #334155;
    color: #f8fafc;           
    padding: 14px 16px;
    font-weight: 600;
    font-size: 16px;
    z-index: 1;
    border-bottom: 2px solid #475569;
  }

  .measurements-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
    font-size: 14px;
  }

  
  .measurements-table tr:hover td {
    background-color: #1e293b;
    filter: brightness(1.2);
  }


  /* TABLE LINKS */
  .row-link, .row-link:visited{
    color: inherit;
    text-decoration: none;
    display: block; 
  }

  .row-link:hover {
    color: #f59e0b;
  }


  /* CHARTS */
  .day-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap; 
  }

  .day-btn, .day-btn:visited {
    background-color: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
  }

  .day-btn:hover {
    border-color: #475569;
    color: #e2e8f0;
  }

  .day-btn.active {
    background-color: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
    font-weight: 600;
  }

  .charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
  }

  .chart-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  }

  .chart-title {
    color: #e2e8f0;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
  }