:root {
  --primary: #0f4a6b;
  --primary-hover: #0c3954;
  --secondary: #1783c6;
  --bg-color: #f8f8f8;
  --text-color: #333333;
  --text-muted: #777777;
  --border-color: #e5e5e5;
  --panel-bg: #ffffff;
  --success: #5cb85c;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --info: #5bc0de;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.42857143;
}

a {
  color: var(--secondary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  background-color: var(--primary);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
}

.navbar .nav-links {
  display: flex;
  height: 100%;
}

.navbar .nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar .nav-item > a {
  color: #fff;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
}
.navbar .nav-item:hover > a {
  background-color: var(--primary-hover);
  text-decoration: none;
}

.navbar .dropdown-menu {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.175);
  border: 1px solid rgba(0,0,0,0.15);
  z-index: 1000;
}
.navbar .nav-item:hover .dropdown-menu {
  display: block;
}
.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: #333;
}
.dropdown-menu a:hover {
  background-color: #f5f5f5;
  text-decoration: none;
}

.navbar .right-nav {
  display: flex;
  height: 100%;
}

/* Main Container */
.container {
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
  padding: 20px 0;
}

.page-header {
  margin: 20px 0 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 9px;
}
.page-header h1 {
  font-size: 36px;
  font-weight: 300;
  color: var(--primary);
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--secondary);
}

/* Layout */
.layout {
  display: flex;
  gap: 30px;
}
.sidebar {
  width: 250px;
  flex-shrink: 0;
}
.main-content {
  flex-grow: 1;
  min-width: 0;
}

/* Sidebar Panels */
.panel {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.panel-heading {
  background-color: #f5f5f5;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-body {
  padding: 15px;
}
.panel-body.no-padding {
  padding: 0;
}

.btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
}
.btn-success {
  background-color: var(--success);
  border-color: #4cae4c;
  color: #fff;
}
.btn-success:hover {
  background-color: #449d44;
}
.btn-info {
  background-color: var(--info);
  border-color: #46b8da;
  color: #fff;
}
.btn-danger {
  background-color: var(--danger);
  border-color: #d43f3a;
  color: #fff;
}
.btn-default {
  background-color: #fff;
  border-color: #ccc;
  color: #333;
}
.btn-block {
  display: block;
  width: 100%;
}

.list-group {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-group-item {
  display: block;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
  color: #555;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-group-item:last-child {
  border-bottom: none;
}
.list-group-item:hover {
  background-color: #f5f5f5;
  text-decoration: none;
}

/* Stat Tiles */
.stat-tiles {
  display: flex;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 20px;
}
.stat-tile {
  flex: 1;
  padding: 20px;
  text-align: center;
  border-right: 1px solid var(--border-color);
  position: relative;
}
.stat-tile:last-child {
  border-right: none;
}
.stat-tile h2 {
  font-size: 36px;
  color: var(--primary);
  margin-bottom: 5px;
  font-weight: 300;
}
.stat-tile p {
  font-size: 11px;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 1px;
}
.stat-tile .icon {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #eee;
}
.stat-tile.services-tile { border-bottom: 3px solid #5bc0de; }
.stat-tile.quotes-tile { border-bottom: 3px solid #5cb85c; }
.stat-tile.tickets-tile { border-bottom: 3px solid #d9534f; }
.stat-tile.invoices-tile { border-bottom: 3px solid #f0ad4e; }

/* Content panels */
.content-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--warning); /* Adjust dynamically */
  border-radius: 4px;
  margin-bottom: 20px;
}
.content-panel.danger-top { border-top-color: var(--danger); }
.content-panel.info-top { border-top-color: var(--info); }
.content-panel.default-top { border-top-color: #777; }

.content-panel-header {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}
.content-panel-body {
  padding: 15px;
}
.content-panel-footer {
  padding: 10px 15px;
  background: #f9f9f9;
  border-top: 1px solid #eee;
  text-align: right;
  font-size: 12px;
}

/* Back-to-hub link shown on every client-portal sub-page */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.back-link:hover {
  background: #f5f5f5;
  border-color: #aaa;
  text-decoration: none;
}

/* Hub page — option tiles */
.option-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: #fbfbfb;
  color: var(--text-color);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.option-tile:hover {
  background: #fff;
  border-color: var(--secondary);
  text-decoration: none;
  transform: translateY(-1px);
}
.option-tile i {
  width: 16px;
  height: 16px;
  color: var(--secondary);
  flex-shrink: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 8px;
  border-top: 1px solid #ddd;
  text-align: left;
}
.table thead th {
  border-bottom: 2px solid #ddd;
  background-color: #f9f9f9;
}
.table-striped tbody tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}
.label {
  display: inline-block;
  padding: .2em .6em .3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25em;
}
.label-success { background-color: var(--success); }
.label-danger { background-color: var(--danger); }
.label-warning { background-color: var(--warning); }
.label-info { background-color: var(--info); }
.label-default { background-color: #777; }

/* Forms */
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 5px;
  font-weight: 700;
}
.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}
textarea.form-control {
  height: auto;
}
