/* ===========================
   ROCKWOOL DEVICE MANAGEMENT STYLES
   =========================== */

/* ===========================
   CSS VARIABLES
   =========================== */
:root {
  /* Background Colors */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3c3c3c;
  --bg-header: #424242;

  /* Text Colors */
  --text-primary: #e0e0e0;
  --text-secondary: #999;
  --text-disabled: #666;

  /* Border Colors */
  --border-primary: #444;
  --border-secondary: #555;
  --border-focus: #777;

  /* Accent Colors */
  --accent-green: #4CAF50;
  --accent-green-hover: #45a049;
  --accent-green-active: #3e8e41;

  /* Status Colors */
  --status-success: #28a745;
  --status-error: #dc3545;
  --status-warning: #ffa500;
  --status-info: #2196f3;

  /* Button Colors */
  --btn-blue: #1976d2;
  --btn-blue-hover: #1565c0;
  --btn-orange: #ff8c00;
  --btn-orange-hover: #e07c00;

  /* Common Values */
  --transition-standard: 0.3s ease;
  --radius-small: 6px;
  --radius-medium: 8px;
  --radius-large: 12px;

  /* Shadows */
  --shadow-standard: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 16px;
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Wyłącz scrollowanie tylko na device.php */
body.no-scroll {
    height: 100vh;
    overflow: hidden;
}

header {
    background: var(--bg-header);
    color: var(--text-primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-standard);
    border-bottom: 1px solid var(--border-primary);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
}

nav {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-medium);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-standard);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--accent-green-hover);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--border-secondary);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Główny wrapper strony */
.main-wrapper {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Wszystkie główne kontenery */
main {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-standard);
    border: 1px solid var(--border-primary);
    margin-bottom: 20px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}


/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-standard);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.4;
}

.btn-action:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-action.btn-primary {
    background: var(--accent-green);
    color: white;
}

.btn-action.btn-primary:hover {
    background: var(--accent-green-hover);
}

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

.btn-action.btn-danger:hover {
    background: #c0392b;
}

.btn-action.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.btn-action.btn-secondary:hover {
    background: var(--border-secondary);
}

.btn-action .icon {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Table Container Styles */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    margin: 0;
    padding: 0 20px;
}

/* Modern Table Styles */

/* Table Sorting Styles */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sort-indicator {
    font-size: 0.8em;
    margin-left: 5px;
    color: var(--accent-green);
    font-weight: bold;
}

.sortable:after {
    content: '↕';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 0.8em;
    transition: opacity 0.2s ease;
}

.sortable:hover:after {
    opacity: 0.6;
}

.sortable.sort-asc:after {
    content: '↑';
    opacity: 1;
    color: var(--accent-green);
}

.sortable.sort-desc:after {
    content: '↓';
    opacity: 1;
    color: var(--accent-green);
}

.sortable.asc::after {
    content: "↑";
    opacity: 1;
    color: var(--accent-blue);
}

.sortable.desc::after {
    content: "↓";
    opacity: 1;
    color: var(--accent-blue);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-standard);
    border: 1px solid var(--border-primary);
    table-layout: fixed;
    margin: 0;
}

.modern-table th,
.modern-table td {
    padding: 0.4rem;
    text-align: left;
    word-wrap: break-word;
    font-size: 0.85rem;
    border-left: none;
    border-right: none;
}

.modern-table tbody tr {
    border-bottom: 1px solid var(--border-primary);
    height: 2rem;
}

#portsTable tbody tr {
    height: 2rem;
    max-height: 2rem;
    min-height: 2rem;
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table th {
    border-bottom: 1px solid var(--border-primary);
}

.modern-table th {
    background: var(--bg-header);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}


.modern-table tbody tr {
    transition: var(--transition-standard);
    background: var(--bg-secondary);
}

.modern-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.modern-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.modern-table tbody tr:nth-child(even):hover {
    background: var(--bg-tertiary);
}

/* Style dla pustych portów */
.modern-table tbody tr.empty-port {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.01) !important;
}

.modern-table tbody tr.empty-port:hover {
    opacity: 1;
    background: var(--bg-tertiary) !important;
}

/* Style dla edytowalnych komórek */
.port-field.editable {
    cursor: pointer;
    position: relative;
}


/* Empty Port Styles */
.empty-port {
    color: var(--text-secondary);
    font-style: italic;
}

.empty-port:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-focus);
    color: var(--text-primary);
}

/* Switch Connection Styles */
.switch-connection {
    background-color: rgba(0, 150, 255, 0.1) !important;
    border-left: 3px solid var(--accent-green) !important;
}

.connection-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    padding: 2px 6px;
    background-color: rgba(0, 150, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.connection-link:hover {
    background-color: rgba(0, 150, 255, 0.2);
    transform: translateX(2px);
    color: var(--text-primary);
}

/* Port Field Styles */
.port-field {
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
    vertical-align: middle;
    height: 1.5rem;
    max-height: 2rem;
    box-sizing: border-box;
}

.port-field.editable {
    cursor: pointer;
}

.port-status {
    color: var(--text-secondary);
    font-size: 0.8em;
    font-style: italic;
}

.connection-info {
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-small);
    background: var(--bg-tertiary);
    transition: var(--transition-standard);
    display: inline-block;
    min-width: 100px;
    text-align: center;
}

.connection-info:hover {
    background: var(--bg-header);
}

/* Form Control Styles */
.form-control {
    width: 100%;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-secondary);
    border-radius: var(--radius-medium);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-standard);
    min-height: 1.5rem;
    max-height: 2rem;
    height: 1.5rem;
    line-height: 1.2;
    vertical-align: middle;
}

/* Column widths for main table (index.php - devicesTable) */
#devicesTable th:nth-child(1), #devicesTable td:nth-child(1) { width: 5%; }   /* Lp */
#devicesTable th:nth-child(2), #devicesTable td:nth-child(2) { width: 20%; }  /* Nazwa */
#devicesTable th:nth-child(3), #devicesTable td:nth-child(3) { width: 25%; }  /* Model */
#devicesTable th:nth-child(4), #devicesTable td:nth-child(4) { width: 15%; }  /* Lokalizacja */
#devicesTable th:nth-child(5), #devicesTable td:nth-child(5) { width: 10%; }  /* Adres IP */
#devicesTable th:nth-child(6), #devicesTable td:nth-child(6) { width: 10%; } /* MAC */
#devicesTable th:nth-child(7), #devicesTable td:nth-child(7) { width: 8%; text-align: center; } /* Akcje */

/* When location column is hidden, redistribute space */
.location-hidden #devicesTable th:nth-child(2),
.location-hidden #devicesTable td:nth-child(2) { width: 25%; } /* Nazwa */
.location-hidden #devicesTable th:nth-child(3),
.location-hidden #devicesTable td:nth-child(3) { width: 20%; } /* Model */
.location-hidden #devicesTable th:nth-child(5),
.location-hidden #devicesTable td:nth-child(5) { width: 18%; } /* Adres IP */
.location-hidden #devicesTable th:nth-child(6),
.location-hidden #devicesTable td:nth-child(6) { width: 19%; } /* MAC */
.location-hidden #devicesTable th:nth-child(7),
.location-hidden #devicesTable td:nth-child(7) { width: 10%; } /* Akcje */

/* Column widths for ports table (device.php) */
#portsTable th, #portsTable td {
    padding: 0.32rem 0.45rem;
    font-size: 0.84rem;
    word-wrap: break-word;
    height: 2rem;
    max-height: 2rem;
    min-height: 2rem;
    vertical-align: middle;
    line-height: 1.35;
    overflow: visible;
}

#portsTable th:nth-child(1), #portsTable td:nth-child(1) { width: 3%; }   /* Nr */
#portsTable th:nth-child(2), #portsTable td:nth-child(2) { width: 6%; }   /* Typ portu */
#portsTable th:nth-child(3), #portsTable td:nth-child(3) { width: 14%; }  /* Nazwa Urządzenia */
#portsTable th:nth-child(4), #portsTable td:nth-child(4) { width: 8%; }   /* Adres IP */
#portsTable th:nth-child(5), #portsTable td:nth-child(5) { width: 9%; }  /* MAC */
#portsTable th:nth-child(6), #portsTable td:nth-child(6) { width: 4%; }   /* VLAN */
#portsTable th:nth-child(7), #portsTable td:nth-child(7) { width: 6%; }   /* Typ */
#portsTable th:nth-child(8), #portsTable td:nth-child(8) { width: 5%; }   /* Zasilanie */
#portsTable th:nth-child(9), #portsTable td:nth-child(9) { width: 7%; }   /* Patch Panel Ethernet */
#portsTable th:nth-child(10), #portsTable td:nth-child(10) { width: 7%; }  /* Patch Panel Światło */
#portsTable th:nth-child(11), #portsTable td:nth-child(11) { width: 21%; } /* Opis */
#portsTable th:nth-child(12), #portsTable td:nth-child(12) { width: 6%; text-align: center; } /* Akcje */

/* Column widths for ports by type table */
#portsTypeTable th, #portsTypeTable td {
    padding: 0.3rem;
    font-size: 0.8rem;
    word-wrap: break-word;
    height: 2rem;
    vertical-align: middle;
}

#portsTypeTable th:nth-child(1), #portsTypeTable td:nth-child(1) { width: 8%; }  /* Pomieszczenie */
#portsTypeTable th:nth-child(2), #portsTypeTable td:nth-child(2) { width: 4%; }   /* Nr */
#portsTypeTable th:nth-child(3), #portsTypeTable td:nth-child(3) { width: 8%; }   /* Typ portu */
#portsTypeTable th:nth-child(4), #portsTypeTable td:nth-child(4) { width: 10%; }  /* Nazwa Urządzenia */
#portsTypeTable th:nth-child(5), #portsTypeTable td:nth-child(5) { width: 8%; }   /* Adres IP */
#portsTypeTable th:nth-child(6), #portsTypeTable td:nth-child(6) { width: 9%; }  /* MAC */
#portsTypeTable th:nth-child(7), #portsTypeTable td:nth-child(7) { width: 5%; }   /* VLAN */
#portsTypeTable th:nth-child(8), #portsTypeTable td:nth-child(8) { width: 5%; }   /* TYP */
#portsTypeTable th:nth-child(9), #portsTypeTable td:nth-child(9) { width: 6%; }   /* Zasilanie */
#portsTypeTable th:nth-child(10), #portsTypeTable td:nth-child(10) { width: 6%; }  /* Patch Panel Ethernet */
#portsTypeTable th:nth-child(11), #portsTypeTable td:nth-child(11) { width: 6%; }  /* Patch Panel Światło */
#portsTypeTable th:nth-child(12), #portsTypeTable td:nth-child(12) { width: 15%; } /* Opis */
#portsTypeTable th:nth-child(13), #portsTypeTable td:nth-child(13) { width: 5%; text-align: center; }  /* Akcje */

/* Location and Room Column Styles */
.location-column,
.room-column {
    transition: all 0.3s ease;
}

/* Hide location columns when location is selected */
.location-hidden .location-column {
    display: none !important;
}

/* Pokaż room-column (będzie zawierać nazwę switcha) */
.location-hidden .room-column {
    display: table-cell !important;
}

/* Adjust column widths for portsTypeTable when location is hidden */
.location-hidden #portsTypeTable th:nth-child(1),
.location-hidden #portsTypeTable td:nth-child(1) { width: 12%; }  /* Switch */
.location-hidden #portsTypeTable th:nth-child(2),
.location-hidden #portsTypeTable td:nth-child(2) { width: 4%; }   /* Nr */
.location-hidden #portsTypeTable th:nth-child(3),
.location-hidden #portsTypeTable td:nth-child(3) { width: 8%; }  /* Typ portu */
.location-hidden #portsTypeTable th:nth-child(4),
.location-hidden #portsTypeTable td:nth-child(4) { width: 11%; }  /* Nazwa Urządzenia */
.location-hidden #portsTypeTable th:nth-child(5),
.location-hidden #portsTypeTable td:nth-child(5) { width: 9%; }  /* Adres IP */
.location-hidden #portsTypeTable th:nth-child(6),
.location-hidden #portsTypeTable td:nth-child(6) { width: 10%; }  /* MAC */
.location-hidden #portsTypeTable th:nth-child(7),
.location-hidden #portsTypeTable td:nth-child(7) { width: 6%; }   /* VLAN */
.location-hidden #portsTypeTable th:nth-child(8),
.location-hidden #portsTypeTable td:nth-child(8) { width: 6%; }   /* TYP */
.location-hidden #portsTypeTable th:nth-child(9),
.location-hidden #portsTypeTable td:nth-child(9) { width: 7%; }   /* Zasilanie */
.location-hidden #portsTypeTable th:nth-child(10),
.location-hidden #portsTypeTable td:nth-child(10) { width: 7%; }  /* Patch Panel Ethernet */
.location-hidden #portsTypeTable th:nth-child(11),
.location-hidden #portsTypeTable td:nth-child(11) { width: 7%; }  /* Patch Panel Światło */
.location-hidden #portsTypeTable th:nth-child(12),
.location-hidden #portsTypeTable td:nth-child(12) { width: 13%; } /* Opis */
.location-hidden #portsTypeTable th:nth-child(13),
.location-hidden #portsTypeTable td:nth-child(13) { width: 5%; }  /* Akcje */

/* Style dla duplikatów MAC */
.duplicate-mac {
    background-color: rgba(255, 152, 0, 0.15) !important;
    color: #e65100 !important;
    font-weight: bold;
}

.duplicate-mac:hover {
    background-color: rgba(255, 152, 0, 0.25) !important;
}

/* Style dla pola połączeń */
.connection-field {
    cursor: pointer;
    transition: var(--transition-standard);
    color: var(--accent-green);
    font-weight: 500;
}

.connection-field:hover {
    background: var(--bg-tertiary);
    color: var(--accent-green-hover);
}

.connection-field:empty {
    color: var(--text-disabled);
}

.connection-field:empty:hover {
    color: var(--text-secondary);
}

/* Table Action Buttons */
.actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
}

.btn-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.6rem;
    text-decoration: none;
    text-align: center;
    min-width: auto;
    margin: 0 2px;
}

.btn-table:hover {
    opacity: 0.7;
}

.btn-table.btn-edit {
    background: transparent;
    color: var(--text-primary);
}

.btn-table.btn-delete {
    background: transparent;
    color: var(--text-primary);
}

.btn-table.btn-view {
    background: transparent;
    color: var(--text-primary);
}

.btn-table.btn-add {
    background: transparent;
    color: var(--text-primary);
}

.btn-table.btn-history {
    background: transparent;
    color: var(--text-primary);
}

.btn-table:hover {
    background: var(--bg-tertiary);
}

/* Device name link */
.device-name {
    cursor: pointer;
    color: var(--accent-green) !important;
    text-decoration: none;
    transition: var(--transition-standard);
}

.device-name:hover {
    color: var(--accent-green-hover) !important;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 2% auto;
    padding: 1.2rem;
    border-radius: var(--radius-large);
    width: 90%;
    max-width: 700px;
    position: relative;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-hover);
}

.modal-content h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-content form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.modal-content .form-group {
    margin-bottom: 0;
}

.modal-content .form-group.full-width {
    grid-column: 1 / -1;
}

.modal-content .form-actions {
    grid-column: 1 / -1;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-standard);
}

.close:hover {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 0.7rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 0.35rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-medium);
    font-size: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition-standard);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--bg-primary);
}

.form-group textarea {
    width: 100%;
    padding: 0.4rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-medium);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition-standard);
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

#modalTitle {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 300;
    font-size: 1.3rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Empty State Styling */
.empty-state {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-medium);
    margin: 2rem 0;
    transition: var(--transition-standard);
}

.empty-state:hover {
    border-color: var(--border-focus);
    background: var(--bg-tertiary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2em;
}

.empty-state p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.error {
    background: var(--status-error);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-medium);
    margin: 1rem 0;
    border-left: 4px solid #c0392b;
}

.success {
    background: var(--status-success);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-medium);
    margin: 1rem 0;
    border-left: 4px solid var(--accent-green);
}

.warning {
    background: var(--status-warning);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-medium);
    margin: 1rem 0;
    border-left: 4px solid #ff6b00;
}

/* Page Header */
.page-header {
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-header {
        flex-direction: column;
        gap: 15px !important;
        align-items: stretch !important;
    }

    .page-header > div {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 1200px) {
    .table-container {
        padding: 0 10px;
    }

    .page-header {
        margin: 10px !important;
    }

    .modern-table {
        font-size: 0.85rem;
    }

    /* Zmniejsz font w tabeli na mniejszych ekranach */
    .modern-table th,
    .modern-table td {
        font-size: 0.75rem;
        padding: 0.2rem 0.3rem !important;
    }
}

@media (max-width: 768px) {
    .table-container {
        padding: 0 5px;
    }

    .page-header {
        margin: 5px !important;
    }

    .btn-action {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .modern-table {
        width: 100%;
        margin: 0;
    }

    .modern-table th,
    .modern-table td {
        font-size: 0.7rem;
        padding: 0.15rem 0.2rem !important;
    }

    /* Hide Model and MAC columns on mobile */
    #devicesTable th:nth-child(3), #devicesTable td:nth-child(3) { /* Model */
        display: none;
    }
    #devicesTable th:nth-child(6), #devicesTable td:nth-child(6) { /* MAC */
        display: none;
    }

    /* Adjust remaining column widths for mobile - 5 columns total */
    #devicesTable th:nth-child(1), #devicesTable td:nth-child(1) { width: 5%; }  /* Lp */
    #devicesTable th:nth-child(2), #devicesTable td:nth-child(2) { width: 28%; }  /* Nazwa */
    #devicesTable th:nth-child(4), #devicesTable td:nth-child(4) { width: 22%; }  /* Lokalizacja */
    #devicesTable th:nth-child(5), #devicesTable td:nth-child(5) { width: 17%; }  /* Adres IP */
    #devicesTable th:nth-child(7), #devicesTable td:nth-child(7) { width: 28%; }  /* Akcje */

    .btn-table {
        padding: 3px 6px;
        font-size: 10px;
    }

    /* Hide some columns in ports table on mobile */
    #portsTable th:nth-child(2), #portsTable td:nth-child(2) { /* Typ portu */
        display: none;
    }
    #portsTable th:nth-child(5), #portsTable td:nth-child(5) { /* MAC */
        display: none;
    }
    #portsTable th:nth-child(6), #portsTable td:nth-child(6) { /* VLAN */
        display: none;
    }
    #portsTable th:nth-child(8), #portsTable td:nth-child(8) { /* Zasilanie */
        display: none;
    }
    #portsTable th:nth-child(9), #portsTable td:nth-child(9) { /* Patch Panel Ethernet */
        display: none;
    }
    #portsTable th:nth-child(10), #portsTable td:nth-child(10) { /* Patch Panel Światło */
        display: none;
    }

    /* Adjust remaining port column widths for mobile - 6 columns total */
    #portsTable th:nth-child(1), #portsTable td:nth-child(1) { width: 8%; }  /* Nr */
    #portsTable th:nth-child(3), #portsTable td:nth-child(3) { width: 25%; }  /* Nazwa Urządzenia */
    #portsTable th:nth-child(4), #portsTable td:nth-child(4) { width: 18%; }  /* Adres IP */
    #portsTable th:nth-child(7), #portsTable td:nth-child(7) { width: 12%; }  /* Typ */
    #portsTable th:nth-child(11), #portsTable td:nth-child(11) { width: 25%; } /* Opis */
    #portsTable th:nth-child(12), #portsTable td:nth-child(12) { width: 12%; }  /* Akcje */
}

/* ===========================
   FORM COMPONENTS
   =========================== */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
  padding: 0.4rem;
  font-size: 0.85rem;
  border-radius: var(--radius-large);
  transition: all var(--transition-standard);
  box-sizing: border-box;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(119, 119, 119, 0.3);
}

input::placeholder {
  color: var(--text-secondary);
}

input:disabled {
  background: #2a2a2a;
  color: var(--text-disabled);
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}