/* Main Styles - Aqualytics Water Management System */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #f0f0f1;
    color: #2c3338;
}

/* Top Admin Bar */
.admin-bar {
    background: #1d2327;
    height: 32px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.admin-bar-logo {
    color: #fff;
    font-size: 20px;
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.admin-bar-title {
    color: #fff;
    font-size: 13px;
    margin-right: 20px;
}

.admin-bar-user {
    margin-left: auto;
    color: #fff;
    font-size: 13px;
}

/* Left Sidebar */
.sidebar {
    background: #1d2327;
    width: 160px;
    position: fixed;
    top: 32px;
    left: 0;
    bottom: 0;
    z-index: 9990;
    overflow-y: auto;
}

.sidebar-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #c3c4c7;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    font-size: 13px;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    color: #72aee6;
    background: #1d2327;
}

.sidebar-link.active {
    color: #fff;
    background: #0a4b78;
    border-left-color: #72aee6;
}

.sidebar-icon {
    margin-right: 8px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-top: 32px;
    margin-left: 160px;
    padding: 20px;
    min-height: calc(100vh - 32px);
    background: #f0f0f1;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.page-title {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    line-height: 1.3;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

/* Page Background Patterns */
#dashboard .page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
#dashboard .page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

#monitor .page-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
#monitor .page-header::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

#billing .page-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
#billing .page-header::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 250px;
    height: 250px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

#reports .page-header {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
#reports .page-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    width: 280px;
    height: 280px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

#analytics .page-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
#analytics .page-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: 10%;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #72aee6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.stat-label {
    font-size: 13px;
    color: #646970;
    margin-bottom: 8px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-change {
    font-size: 13px;
    color: #00a32a;
    font-weight: 400;
}

/* Control Groups */
.control-group {
    background: #ffffff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.control-group h3 {
    color: #1d2327;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-input, .form-select {
    width: 100%;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    color: #2c3338;
    font-size: 13px;
    box-shadow: 0 0 0 transparent;
    transition: box-shadow 0.1s linear;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 400;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #2271b1;
    color: white;
}

.btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.btn-success {
    background: #00a32a;
    color: white;
    border-color: #00a32a;
}

.btn-success:hover {
    background: #008a20;
    border-color: #008a20;
}

.btn-danger {
    background: #d63638;
    color: white;
    border-color: #d63638;
}

.btn-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* Tables */
.billing-table {
    width: 100%;
    background: #ffffff;
    border: 1px solid #c3c4c7;
    border-collapse: collapse;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.billing-table th {
    background: #f6f7f7;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    color: #2c3338;
    font-weight: 600;
    border-bottom: 1px solid #c3c4c7;
}

.billing-table td {
    padding: 12px;
    border-bottom: 1px solid #dcdcde;
    font-size: 13px;
    color: #2c3338;
}

.billing-table tr:hover {
    background: #f6f7f7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
    font-size: 18px;
    color: #1d2327;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #dcdcde;
}
