/* Modern CSS Styles - matches new design */

/* Base Typography */

:root { scrollbar-gutter: stable; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8f9fa;
    color: #2d3748;
}

/* Links */
a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #2c5282;
    text-decoration: underline;
}

a:visited {
    color: #5a67d8;
}

/* Headings */
h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

/* Form Elements */
input, textarea, select {
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    color: #2d3748;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

input:disabled, textarea:disabled, select:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Buttons */
button, input[type="submit"], input[type="button"] {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: #3182ce;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: #2c5282;
}

button:active, input[type="submit"]:active, input[type="button"]:active {
    transform: scale(0.98);
}

td.shadeOrange, tr.shadeOrange td {
    background: #ffe5b4; /* lys oransje */
    color: #7b341e;
}


/* Modern Tables */
.table-container {
  max-width: 100%;
  overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Table Headers */

th, td.shadeTop {
    background: linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
    font-weight: 600;
    color: #2d3748;
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.875rem;
}

/* Table Cells */
td {
    padding: 0.875rem 1rem;
    color: #4a5568;
    font-size: 0.875rem;
    border-bottom: 1px solid #f7fafc;
    vertical-align: middle;

}

/* Alternating Row Colors */
tr:nth-child(even) td {
    background: #f7fafc;
}

tr:nth-child(odd) td {
    background: white;
}

/* Row Hover Effect */
tbody tr:hover td {
    background: #edf2f7;
    transition: background 0.15s;
}

/* Special Row States */
td.noshade, tr.noshade td {
    background: white;
}

td.shade, tr.shade td {
    background: #f7fafc;
}



/* Responsive Tables */
@media (max-width: 768px) {
    /* Make tables scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    table {
        min-width: 600px;
        box-shadow: none;
    }
    
    th, td, td.shadeTop {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Stack table for very small screens */
    .table-stack {
        min-width: 100%;
    }
    
    .table-stack thead {
        display: none;
    }
    
    .table-stack tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .table-stack td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border-bottom: 1px solid #f7fafc;
    }
    
    .table-stack td:last-child {
        border-bottom: none;
    }
    
    .table-stack td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        margin-right: 1rem;
    }
}

/* Table Utilities */
table.compact td, table.compact th {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

table.bordered {
    border: 1px solid #e2e8f0;
}

table.striped tbody tr:nth-child(odd) td {
    background: white;
}

table.striped tbody tr:nth-child(even) td {
    background: #f7fafc;
}

table.hoverable tbody tr:hover td {
    background: #edf2f7;
    cursor: pointer;
}

/* Cell Alignment */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Text Utilities */
.text-bold {
    font-weight: 600;
}

.text-muted {
    color: #718096;
}

.text-small {
    font-size: 0.8125rem;
}

/* Spacing Utilities */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Cards - for wrapping content */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    background: #edf2f7;
    color: #4a5568;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-warning {
    background: #fef5e7;
    color: #744210;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}


.nav-menu {
    flex: 1;
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: #f7fafc;
    color: #2d3748;
}

.nav-link.active {
    background: #ebf8ff;
    color: #3182ce;
    border-right: 3px solid #3182ce;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #3182ce;
}

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

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f7fafc;
}

.submenu.open {
    max-height: 500px;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.submenu-link:hover {
    background: white;
    color: #4a5568;
}

.submenu-link.active {
    color: #3182ce;
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: #718096;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #4a5568;
}
/* slå av skalering kun for burgerknappen */
.mobile-menu-btn:active { transform: none !important; }


.content-area {
    padding: 2rem;
}

/* Skjul hele top-bar på desktop */
@media (min-width: 769px) {
  .top-bar {
    display: none;
  }
}

/* Vis top-bar kun på mobil */
@media (max-width: 768px) {
  .top-bar {
    display: flex;   /* eller block – avhenger av ditt oppsett */
    align-items: center;
    justify-content: space-between;
  }
}


/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
.mobile-menu-btn:hover {
    color: white;   /* ikonet arver dette og blir hvitt */
}
    
    .top-bar {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f7fafc;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}


/* Spam score text colors */
.score-orange  { color: #d97706; font-weight: 600; } /* lav score */
.score-yellow  { color: #b7791f; font-weight: 600; }
.score-red     { color: #e53e3e; font-weight: 600; }
.score-redhigh { color: #9b2c2c; font-weight: 700; }

/* Fix for input width on mobile (login card) */
.card form {
    width: 100%;
}

.card input[type="text"],
.card input[type="email"],
.card input[type="password"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Fjern evt. uønsket scroll */
body {
    overflow-x: hidden;
}

/* === FINAL FIX: prevent input overflow in login card === */
.card {
  width: 100%;
  max-width: 400px;      /* hindrer kortet fra å bli for bredt */
  margin: 0 auto;        /* sentrer kortet */
  box-sizing: border-box;
  overflow: hidden;      /* klipp alt som skulle ut */
}

.card * {
  max-width: 100%;       /* ingen barn får vokse ut av kortet */
  box-sizing: border-box;
}

/* spesifikt for inputs og submit */
.card input[type="text"],
.card input[type="email"],
.card input[type="password"],
.card input[type="submit"],
.card button {
  width: calc(100% - 0.75rem); /* litt mindre enn full bredde */
  display: block;
  margin: 0 auto;              /* sentrer horisontalt */
}

/* på mobil, litt ekstra luft */
@media (max-width: 768px) {
  .card {
    margin: 1rem;
    padding: 1.25rem;
  }
}

/* --- Override for login page tables --- */
.card table {
    min-width: unset !important;
    width: 100% !important;
}